forked from DGNum/gestioCOF
Merge branch 'master' into Kerl/fix_32_do_tirage
This commit is contained in:
commit
6d613def4c
30 changed files with 368 additions and 163 deletions
28
bda/admin.py
28
bda/admin.py
|
@ -1,4 +1,8 @@
|
|||
# coding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.mail import send_mail
|
||||
|
||||
|
@ -52,9 +56,9 @@ class ParticipantAdmin(admin.ModelAdmin):
|
|||
def total(self, obj):
|
||||
tot = obj.total
|
||||
if tot:
|
||||
return u"%.02f €" % tot
|
||||
return "%.02f €" % tot
|
||||
else:
|
||||
return u"0 €"
|
||||
return "0 €"
|
||||
total.admin_order_field = "total"
|
||||
total.short_description = "Total à payer"
|
||||
list_display = ("user", "nb_places", "total", "paid", "paymenttype",
|
||||
|
@ -70,7 +74,7 @@ class ParticipantAdmin(admin.ModelAdmin):
|
|||
for member in queryset.all():
|
||||
attribs = member.attributions.all()
|
||||
if len(attribs) == 0:
|
||||
mail = u"""Cher-e %s,
|
||||
mail = """Cher-e %s,
|
||||
|
||||
Tu t'es inscrit-e pour le tirage au sort du BdA. Malheureusement, tu n'as
|
||||
obtenu aucune place.
|
||||
|
@ -85,7 +89,7 @@ Le Bureau des Arts
|
|||
name = member.user.get_full_name()
|
||||
mail = mail % name
|
||||
else:
|
||||
mail = u"""Cher-e %s,
|
||||
mail = """Cher-e %s,
|
||||
|
||||
Tu t'es inscrit-e pour le tirage au sort du BdA. Tu as été sélectionné-e
|
||||
pour les spectacles suivants :
|
||||
|
@ -120,7 +124,7 @@ Le Bureau des Arts
|
|||
attribs_text = ""
|
||||
name = member.user.get_full_name()
|
||||
for attrib in attribs:
|
||||
attribs_text += u"- 1 place pour %s\n" % attrib
|
||||
attribs_text += "- 1 place pour %s\n" % attrib
|
||||
deadline = member.tirage.fermeture + timedelta(days=7)
|
||||
mail = mail % (name, attribs_text,
|
||||
deadline.strftime('%d %b %Y'))
|
||||
|
@ -129,14 +133,14 @@ Le Bureau des Arts
|
|||
fail_silently=True)
|
||||
count = len(queryset.all())
|
||||
if count == 1:
|
||||
message_bit = u"1 membre a"
|
||||
message_bit = "1 membre a"
|
||||
plural = ""
|
||||
else:
|
||||
message_bit = u"%d membres ont" % count
|
||||
message_bit = "%d membres ont" % count
|
||||
plural = "s"
|
||||
self.message_user(request, u"%s été informé%s avec succès."
|
||||
self.message_user(request, "%s été informé%s avec succès."
|
||||
% (message_bit, plural))
|
||||
send_attribs.short_description = u"Envoyer les résultats par mail"
|
||||
send_attribs.short_description = "Envoyer les résultats par mail"
|
||||
|
||||
|
||||
class AttributionAdminForm(forms.ModelForm):
|
||||
|
@ -147,8 +151,8 @@ class AttributionAdminForm(forms.ModelForm):
|
|||
if participant and spectacle:
|
||||
if participant.tirage != spectacle.tirage:
|
||||
raise forms.ValidationError(
|
||||
u"Erreur : le participant et le spectacle n'appartiennent"
|
||||
u"pas au même tirage")
|
||||
"Erreur : le participant et le spectacle n'appartiennent"
|
||||
"pas au même tirage")
|
||||
return cleaned_data
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue