forked from DGNum/gestioCOF
Version 1.1 remise à zéro comptes COF
This commit is contained in:
parent
ba74779f95
commit
c100f2fc8d
2 changed files with 8 additions and 10 deletions
|
@ -3,11 +3,12 @@
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
<h2>Remise à zéro des membres COF</h2>
|
<h2>Remise à zéro des membres COF</h2>
|
||||||
{% if is_done%}
|
{% if is_done%}
|
||||||
Order 66 done
|
<p> {{nb_adherents}} compte{{ nb_adherents|pluralize }} désinscrit{{ nb_adherents|pluralize }} du COF.</p>
|
||||||
{% else%}
|
{% else%}
|
||||||
|
<div class="alert alert-danger"> ATTENTION : Cette action est irréversible. </div>
|
||||||
<p> Voulez-vous vraiment remettre à zéro le statut COF de tous les membres actuels ?</p>
|
<p> Voulez-vous vraiment remettre à zéro le statut COF de tous les membres actuels ?</p>
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
<input type='submit' value="Confirmer">{% csrf_token %}
|
<input type='submit' value="Confirmer" class="btn btn-primary pull-right">{% csrf_token %}
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -82,20 +82,17 @@ class ResetComptes(BuroRequiredMixin, TemplateView):
|
||||||
template_name = "gestioncof/reset_comptes.html"
|
template_name = "gestioncof/reset_comptes.html"
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
|
nb_adherents = CofProfile.objects.filter(is_cof=True).count()
|
||||||
CofProfile.objects.update(
|
CofProfile.objects.update(
|
||||||
is_cof = False,
|
is_cof = False,
|
||||||
mailing_cof=False,
|
mailing_cof=False,
|
||||||
mailing_bda=False,
|
mailing_bda=False,
|
||||||
mailing_bda_revente=False,
|
mailing_bda_revente=False,
|
||||||
mailing_unernestaparis=False)
|
mailing_unernestaparis=False)
|
||||||
context = self.get_context_data()
|
context = super().get_context_data()
|
||||||
return render(request, self.template_name, context)
|
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
|
||||||
context = super().get_context_data(**kwargs)
|
|
||||||
if self.request.method == 'POST':
|
|
||||||
context['is_done'] = True
|
context['is_done'] = True
|
||||||
return context
|
context['nb_adherents'] = nb_adherents
|
||||||
|
return render(request, self.template_name, context)
|
||||||
|
|
||||||
|
|
||||||
def login(request):
|
def login(request):
|
||||||
|
|
Loading…
Reference in a new issue