mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-25 09:11:13 +00:00
Matmat renames
This commit is contained in:
parent
dc571836ae
commit
a9e23920ee
@ -144,14 +144,14 @@ class CanViewMixin(View):
|
||||
return super(CanViewMixin, self).dispatch(request, *arg, **kwargs)
|
||||
|
||||
|
||||
class WasSuscribed(View):
|
||||
class FormerSubscriberMixin(View):
|
||||
"""
|
||||
This view check if the user was at least an old subscriber
|
||||
"""
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not request.user.was_subscribed:
|
||||
raise PermissionDenied
|
||||
return super(WasSuscribed, self).dispatch(request, *args, **kwargs)
|
||||
return super(FormerSubscriberMixin, self).dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class TabedViewMixin(View):
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- coding:utf-8 -*
|
||||
#
|
||||
# Copyright 2017
|
||||
# - Sli <skia@libskia.so>
|
||||
# - Sli <antoine@bartuccio.fr>
|
||||
#
|
||||
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
|
||||
# http://ae.utbm.fr.
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- coding:utf-8 -*
|
||||
#
|
||||
# Copyright 2017
|
||||
# - Sli <skia@libskia.so>
|
||||
# - Sli <antoine@bartuccio.fr>
|
||||
#
|
||||
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
|
||||
# http://ae.utbm.fr.
|
||||
@ -33,7 +33,7 @@ from django.core.urlresolvers import reverse
|
||||
from django import forms
|
||||
|
||||
from core.models import User
|
||||
from core.views import WasSuscribed
|
||||
from core.views import FormerSubscriberMixin
|
||||
from core.views.forms import SelectDate
|
||||
from core.views import search_user
|
||||
from phonenumber_field.widgets import PhoneNumberInternationalFallbackWidget
|
||||
@ -93,7 +93,7 @@ class SearchForm(forms.ModelForm):
|
||||
# Views
|
||||
|
||||
|
||||
class SearchFormListView(WasSuscribed, SingleObjectMixin, ListView):
|
||||
class SearchFormListView(FormerSubscriberMixin, SingleObjectMixin, ListView):
|
||||
model = User
|
||||
ordering = ["-id"]
|
||||
paginate_by = 12
|
||||
@ -159,7 +159,7 @@ class SearchFormListView(WasSuscribed, SingleObjectMixin, ListView):
|
||||
return q
|
||||
|
||||
|
||||
class SearchFormView(WasSuscribed, FormView):
|
||||
class SearchFormView(FormerSubscriberMixin, FormView):
|
||||
"""
|
||||
Allows users to search inside the user list
|
||||
"""
|
||||
@ -203,7 +203,7 @@ class SearchQuickFormView(SearchFormView):
|
||||
search_type = SearchType.QUICK
|
||||
|
||||
|
||||
class SearchClearFormView(WasSuscribed, View):
|
||||
class SearchClearFormView(FormerSubscriberMixin, View):
|
||||
"""
|
||||
Clear SearchFormView and redirect to it
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user