mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
make PageCreateView a PermissionRequiredMixin
This commit is contained in:
@ -169,10 +169,9 @@ class CanCreateMixin(View):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def dispatch(self, request, *arg, **kwargs):
|
||||
res = super().dispatch(request, *arg, **kwargs)
|
||||
if not request.user.is_authenticated:
|
||||
raise PermissionDenied
|
||||
return res
|
||||
return super().dispatch(request, *arg, **kwargs)
|
||||
|
||||
def form_valid(self, form):
|
||||
obj = form.instance
|
||||
|
Reference in New Issue
Block a user