Suppression de code mort
La fonction `send_choices` n'est pas branchée et donc pas utilisée. De plus elle est inutile, les vœux des participants étant accessibles en ligne.
This commit is contained in:
parent
2a1c870cac
commit
34e23c898a
1 changed files with 0 additions and 36 deletions
36
bda/admin.py
36
bda/admin.py
|
@ -37,42 +37,6 @@ class ParticipantAdmin(admin.ModelAdmin):
|
|||
actions_on_bottom = True
|
||||
list_per_page = 400
|
||||
|
||||
def send_choices(self, request, queryset):
|
||||
for member in queryset.all():
|
||||
choices = member.choixspectacle_set.order_by('priority').all()
|
||||
if len(choices) == 0:
|
||||
continue
|
||||
mail = u"""Cher(e) %s,
|
||||
Voici tes choix de spectacles tels que notre système les a enregistrés :\n\n""" % member.user.get_full_name()
|
||||
next_rank = 1
|
||||
member_shows = {}
|
||||
for choice in choices:
|
||||
if choice.spectacle in member_shows: continue
|
||||
else: member_shows[choice.spectacle] = True
|
||||
extra = ""
|
||||
if choice.double:
|
||||
extra += u" ; deux places"
|
||||
if choice.autoquit:
|
||||
extra += u" ; désistement automatique"
|
||||
mail += u"- Choix %d : %s%s\n" % (next_rank, choice.spectacle, extra)
|
||||
next_rank += 1
|
||||
mail += u"""\nSi cette liste est incorrecte, merci de nous contacter au plus vite (avant samedi 6 octobre 18h).
|
||||
|
||||
Artistiquement,
|
||||
Le BdA"""
|
||||
send_mail ("Choix de spectacles (BdA du COF)", mail,
|
||||
"bda@ens.fr", [member.user.email],
|
||||
fail_silently = True)
|
||||
count = len(queryset.all())
|
||||
if count == 1:
|
||||
message_bit = u"1 membre a"
|
||||
plural = ""
|
||||
else:
|
||||
message_bit = u"%d membres ont" % count
|
||||
plural = "s"
|
||||
self.message_user(request, u"%s été informé%s avec succès." % (message_bit, plural))
|
||||
send_choices.short_description = u"Envoyer les choix par mail"
|
||||
|
||||
def send_attribs(self, request, queryset):
|
||||
for member in queryset.all():
|
||||
attribs = member.attributions.all()
|
||||
|
|
Loading…
Reference in a new issue