diff --git a/bikeshop_project/core/views.py b/bikeshop_project/core/views.py index 4cd330d..8c1bc97 100644 --- a/bikeshop_project/core/views.py +++ b/bikeshop_project/core/views.py @@ -5,6 +5,8 @@ from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.template.response import TemplateResponse from django.views.generic import TemplateView, View +from django.utils.decorators import method_decorator +from django.contrib.auth.decorators import login_required from registration.models import Member @@ -13,11 +15,12 @@ from .forms import MembershipForm, PaymentForm logger = logging.getLogger(__name__) +@method_decorator(login_required, name='dispatch') class DashboardView(View): def get(self, request): return TemplateResponse(request, 'dashboard.html') - +@method_decorator(login_required, name='dispatch') class NewMembershipView(TemplateView): template_name = 'membership_form.html'