Commit 3b47eb48 authored by Antoine Bernard's avatar Antoine Bernard

fix, affichage impression

On affiche les comptes qu'un utilisateur peut utiliser pour imprimer.
parent ad3c5d36
......@@ -144,6 +144,7 @@ class PrintForm(forms.Form):
class ClubForm(forms.Form):
club_list = forms.ChoiceField(label=_(u'Imprimer pour'), required=False)
def __init__(self, ldap_user, *args, **kwargs):
super(ClubForm, self).__init__(*args, **kwargs)
liste_compte = []
......@@ -155,8 +156,8 @@ class ClubForm(forms.Form):
solde = u" (0\u20AC)"
label = unicode(compte['nom'][0]) + solde
uid = compte['uid'][0]
if (uid,label) not in liste_compte:
liste_compte.append((uid,label))
if (uid, label) not in liste_compte:
liste_compte.append((uid, label))
except KeyError:
pass
self.fields['club_list'].choices = tuple(liste_compte)
......
......@@ -15,14 +15,12 @@
{{ form.fichier.help_text }}
{% endfor %}
</div>
{% if clubform.club_list.choices|length > 1 %}
<div class="six columns">
{{ clubform.club_list.label_tag }}
{{ clubform.club_list }}
{{ clubform.club_list.errors }}
{{ clubform.club_list.help_text }}
</div>
{% endif %}
</div>
<footer>
<a href="{% url 'impressions:gestion' %}" class="button">{% trans "Liste des tâches" %}</a>
......
......@@ -134,7 +134,7 @@ def view(request):
else:
if "SubmitUploadForm" in request.POST.keys():
# On formate et on instancie pour les clubs
clubform = ClubForm(ldap_user,request.POST)
clubform = ClubForm(ldap_user, request.POST)
# Si impression en tant que club, on récupère le resultat
club = False
if clubform.is_valid() and not clubform.cleaned_data['club_list'] == ldap_user['uid'][0]:
......
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