Commit 42f8ee35 authored by Sli's avatar Sli
Browse files

Merge branch 'teeshirt' into 'master'

Fix translations error for gifts

See merge request ae/Sith!131
parents 6ee1ee36 eb485215
Pipeline #1394 passed with stage
in 5 minutes and 43 seconds
......@@ -1118,7 +1118,14 @@ class Gift(models.Model):
user = models.ForeignKey(User, related_name='gifts')
def __str__(self):
return "%s - %s" % (self.label,'%d %b %Y'))
return "%s - %s" % (self.translated_label,'%d %b %Y'))
def translated_label(self):
translations = [label[1] for label in settings.SITH_GIFT_LIST if label[0] == self.label]
if len(translations) > 0:
return translations[0]
return self.label
def is_owned_by(self, user):
return user.is_board_member or user.is_root
Supports Markdown
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