diff --git a/smash/web/views/__init__.py b/smash/web/views/__init__.py index 9a8ed660a3ba8424b17d85a53d890c66c76cfd66..6f232ada314602f128abdad7dc2601e2c153f42d 100644 --- a/smash/web/views/__init__.py +++ b/smash/web/views/__init__.py @@ -2,6 +2,7 @@ from django.conf import settings from django.contrib.auth.decorators import login_required from django.shortcuts import redirect, render +from django.utils.decorators import method_decorator from django.views.generic.base import ContextMixin from notifications import get_notifications @@ -53,11 +54,15 @@ def extend_context(params, request): return final_params +@method_decorator(login_required, name='dispatch') class WrappedView(ContextMixin): def get_context_data(self, **kwargs): context = super(WrappedView, self).get_context_data(**kwargs) return extend_context(context, self.request) + def dispatch(self, *args, **kwargs): + return super(WrappedView, self).dispatch(*args, **kwargs) + import auth import appointment