Verified Commit eb485215 authored by Sli's avatar Sli
Browse files

Fix translations error for gifts

parent 6ee1ee36
Pipeline #1393 passed with stage
in 5 minutes and 44 seconds
......@@ -1118,7 +1118,14 @@ class Gift(models.Model):
user = models.ForeignKey(User, related_name='gifts')
def __str__(self):
return "%s - %s" % (self.label, self.date.strftime('%d %b %Y'))
return "%s - %s" % (self.translated_label, self.date.strftime('%d %b %Y'))
@property
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