Commit 446824b6 authored by Charlie Jacomme's avatar Charlie Jacomme

[compte] Impression ticket et reset mdp

parent 5185ad8d
{% extends "template.html" %}
{% block title %} Mot de passe {% endblock %}
{% block h1 %} Changement de mon mot de passe Cr@ns {% endblock %}
{% block h1 %} Changement du mot de passe Cr@ns {% endblock %}
{% block content %}
<form class="form-full-width" method="post">{% csrf_token %}
<div class="error-container">
......@@ -32,6 +32,16 @@
<input type="submit" value="Enregistrer">
</footer>
</form>
{% if ptype == "adh" and cablage %}
<h2> A la Kfet </h2>
<div class="row">
<div class="six columns">
<a href="{% url 'compte:resetpass' ide %}" class="button-cancel">Réinitialiser le mot de passe et imprimer un ticket</a>
</div>
</div>
{% endif %}
{% endblock %}
......@@ -38,4 +38,5 @@ views.delete_alias, name='delete_alias'),
url('^delete/(?P<ptype>adh)/(?P<uid>[0-9]+)/$', views.delete, name='delete'),
url('^create/$', views.create, name='create'),
url('^create/(?P<confirm>confirm)/$$', views.create, name='create'),
url('^resetpass/(?P<uid>[0-9]+)/$', views.resetpass, name='resetpass'),
)
......@@ -660,3 +660,14 @@ class CreateCompteView(CableurMixin, View):
return render(request, self.template_name, {'form1' : form1, 'form2' : form2, 'form3' : form3, 'confirm' : confirm})
create = CreateCompteView.as_view()
class ResetPassView(CableurMixin, View, RedirectHomeMixin):
"""
Classe pour la réinitialisation du mot de passe et l'impression d'un ticket
"""
def get(self, request, uid, next='/compte/', *args, **kwargs):
subprocess.call(['/usr/scripts/cransticket/dump_creds.py','--pass','--forced','aid=%s' % uid])
messages.success(request, u"""Mot de passe réinitialisé, ticket en cours d'impression.""")
return redirect(next)
resetpass = ResetPassView.as_view()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment