From: Guillaume Pellerin Date: Thu, 24 Sep 2015 21:15:09 +0000 (+0200) Subject: fix empty artist X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=888444d83b2c884a4a486c90fc34e1285004767f;p=diggersdigest.git fix empty artist --- diff --git a/app/records/models.py b/app/records/models.py index a2ef41c..d25ffc0 100644 --- a/app/records/models.py +++ b/app/records/models.py @@ -254,7 +254,10 @@ class Record(models.Model): product = models.OneToOneField(Product, verbose_name=_('product'), related_name='record', blank=True, null=True, on_delete=models.SET_NULL) def __unicode__(self): - return " - ".join([self.artist.name, self.title]) + if self.artist: + return " - ".join([self.artist.name, self.title]) + else: + return self.title def get_candidate_images(self): candidates = []