mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 20:09:25 +00:00
Add consent form for eurok partnership
This commit is contained in:
@ -227,6 +227,19 @@ class FormerSubscriberMixin(AccessMixin):
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class IsSubscriberMixin(AccessMixin):
|
||||
"""Check if the user is a subscriber.
|
||||
|
||||
Raises:
|
||||
PermissionDenied: if the user isn't subscribed.
|
||||
"""
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not request.user.is_subscribed:
|
||||
raise PermissionDenied
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class PermissionOrAuthorRequiredMixin(PermissionRequiredMixin):
|
||||
"""Require that the user has the required perm or is the object author.
|
||||
|
||||
|
Reference in New Issue
Block a user