From 44b001bd3c95190b2fca6de2ba04a7d5424c61e7 Mon Sep 17 00:00:00 2001 From: Alseidon Date: Thu, 7 Jan 2021 09:19:56 +0100 Subject: [PATCH] Satisfy Lord Black --- gestioncof/urls.py | 2 -- gestioncof/views.py | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gestioncof/urls.py b/gestioncof/urls.py index a35df9ed..d0ba75c7 100644 --- a/gestioncof/urls.py +++ b/gestioncof/urls.py @@ -82,9 +82,7 @@ urlpatterns = [ # Misc # ----- path("", views.HomeView.as_view(), name="home"), - path("reset_comptes/", views.ResetComptes.as_view(), name="reset_comptes"), - path( "user/autocomplete", views.UserAutocompleteView.as_view(), diff --git a/gestioncof/views.py b/gestioncof/views.py index 7e3c2cc4..fbe74ec7 100644 --- a/gestioncof/views.py +++ b/gestioncof/views.py @@ -78,20 +78,22 @@ class HomeView(LoginRequiredMixin, TemplateView): context["now"] = timezone.now() return context + class ResetComptes(BuroRequiredMixin, TemplateView): template_name = "gestioncof/reset_comptes.html" def post(self, request): nb_adherents = CofProfile.objects.filter(is_cof=True).count() CofProfile.objects.update( - is_cof = False, + is_cof=False, mailing_cof=False, mailing_bda=False, mailing_bda_revente=False, - mailing_unernestaparis=False) + mailing_unernestaparis=False, + ) context = super().get_context_data() - context['is_done'] = True - context['nb_adherents'] = nb_adherents + context["is_done"] = True + context["nb_adherents"] = nb_adherents return render(request, self.template_name, context)