Prevent side effects while sending emails

This commit is contained in:
Martin Pépin 2017-03-29 18:17:20 +01:00
parent 579711ed2d
commit 2d22c202e9

View file

@ -315,10 +315,11 @@ class SpectacleRevente(models.Model):
# Envoie un mail aux perdants # Envoie un mail aux perdants
for inscrit in inscrits: for inscrit in inscrits:
if inscrit != winner: if inscrit != winner:
context['acheteur'] = inscrit.user new_context = dict(context)
new_context['acheteur'] = inscrit.user
datatuple.append(( datatuple.append((
'bda-revente-loser', 'bda-revente-loser',
context, new_context,
settings.MAIL_DATA['revente']['FROM'], settings.MAIL_DATA['revente']['FROM'],
[inscrit.user.email] [inscrit.user.email]
)) ))