Remise à zéro basique comptes COF
This commit is contained in:
parent
340f8f16a7
commit
73c068055b
3 changed files with 21 additions and 0 deletions
5
gestioncof/templates/gestioncof/reset_comptes.html
Normal file
5
gestioncof/templates/gestioncof/reset_comptes.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% extends "base_title.html" %}
|
||||
|
||||
{% block realcontent %}
|
||||
<p> Order 66 done </p>
|
||||
{% endblock %}
|
|
@ -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(),
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue