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 %}
|
||||
<h2>Remise à zéro des membres COF</h2>
|
||||
{% if is_done%}
|
||||
Order 66 done
|
||||
<p> {{nb_adherents}} compte{{ nb_adherents|pluralize }} désinscrit{{ nb_adherents|pluralize }} du COF.</p>
|
||||
{% else%}
|
||||
<p> Voulez-vous vraiment remettre à zéro le statut COF de tous les membres actuels ? </p>
|
||||
<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>
|
||||
<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>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -82,21 +82,18 @@ 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,
|
||||
mailing_cof=False,
|
||||
mailing_bda=False,
|
||||
mailing_bda_revente=False,
|
||||
mailing_unernestaparis=False)
|
||||
context = self.get_context_data()
|
||||
context = super().get_context_data()
|
||||
context['is_done'] = True
|
||||
context['nb_adherents'] = nb_adherents
|
||||
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
|
||||
return context
|
||||
|
||||
|
||||
def login(request):
|
||||
if request.user.is_authenticated:
|
||||
|
|
Loading…
Reference in a new issue