Remise à zéro basique comptes COF

This commit is contained in:
Alseidon 2020-12-09 21:57:40 +01:00
parent 340f8f16a7
commit 73c068055b
3 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,5 @@
{% extends "base_title.html" %}
{% block realcontent %}
<p> Order 66 done </p>
{% endblock %}

View file

@ -82,6 +82,9 @@ 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(),

View file

@ -78,6 +78,19 @@ class HomeView(LoginRequiredMixin, TemplateView):
context["now"] = timezone.now()
return context
class ResetComptes(LoginRequiredMixin, TemplateView):
template_name = "gestioncof/reset_comptes.html"
def get(self, request):
for profile in CofProfile.objects.all():
profile.is_cof = False
profile.mailing_cof = False
profile.mailing_bda = False
profile.mailing_bda_revent = False
profile.mailing_unernestaparis = False
profile.save()
return super().get(request)
def login(request):
if request.user.is_authenticated: