From aa95263fc9a5057bcd771824de56e47680bf7c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 9 Jul 2016 12:52:53 +0200 Subject: [PATCH] Fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - La fonction de hashage dans `bda/views` ne fonctionnait plus en py3 - L'attribut `tirage` des participants a été supprimé lors du dernier merge avec master. --- bda/models.py | 9 +++++---- bda/views.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bda/models.py b/bda/models.py index d7d64db0..c0eafc1a 100644 --- a/bda/models.py +++ b/bda/models.py @@ -115,6 +115,7 @@ PAYMENT_TYPES = ( ) +@python_2_unicode_compatible class Participant(models.Model): user = models.ForeignKey(User) choices = models.ManyToManyField(Spectacle, @@ -123,14 +124,14 @@ class Participant(models.Model): attributions = models.ManyToManyField(Spectacle, through="Attribution", related_name="attributed_to") - paid = models.BooleanField(u"A payé", default=False) - paymenttype = models.CharField(u"Moyen de paiement", + paid = models.BooleanField("A payé", default=False) + paymenttype = models.CharField("Moyen de paiement", max_length=6, choices=PAYMENT_TYPES, blank=True) tirage = models.ForeignKey(Tirage) - def __unicode__(self): - return u"%s" % (self.user) + def __str__(self): + return "%s" % (self.user) DOUBLE_CHOICES = ( ("1", "1 place"), diff --git a/bda/views.py b/bda/views.py index 1ca76a5a..d9b63615 100644 --- a/bda/views.py +++ b/bda/views.py @@ -65,7 +65,7 @@ def etat_places(request, tirage_id): def _hash_queryset(queryset): - data = serializers.serialize("json", queryset) + data = serializers.serialize("json", queryset).encode() hasher = hashlib.sha256() hasher.update(data) return hasher.hexdigest()