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