From a9e23920ee5060be077f0d74aa68eb21bb55791e Mon Sep 17 00:00:00 2001 From: klmp200 Date: Mon, 24 Jul 2017 12:33:34 +0200 Subject: [PATCH] Matmat renames --- core/views/__init__.py | 4 ++-- matmat/urls.py | 2 +- matmat/views.py | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/views/__init__.py b/core/views/__init__.py index b8205f57..c27470f5 100644 --- a/core/views/__init__.py +++ b/core/views/__init__.py @@ -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): diff --git a/matmat/urls.py b/matmat/urls.py index b09ea137..24557952 100644 --- a/matmat/urls.py +++ b/matmat/urls.py @@ -1,7 +1,7 @@ # -*- coding:utf-8 -* # # Copyright 2017 -# - Sli +# - Sli # # Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM, # http://ae.utbm.fr. diff --git a/matmat/views.py b/matmat/views.py index b6422ae0..46b46013 100644 --- a/matmat/views.py +++ b/matmat/views.py @@ -1,7 +1,7 @@ # -*- coding:utf-8 -* # # Copyright 2017 -# - Sli +# - Sli # # 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 """