]> git.parisson.com Git - diggersdigest.git/commitdiff
fix empty artist
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 21:15:09 +0000 (23:15 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 21:15:09 +0000 (23:15 +0200)
app/records/models.py

index a2ef41c9f92f7fcf3cd4143e2fdf998a562b9dd1..d25ffc0a8d04feb02ffe2baec5252cb7aa4ab2b8 100644 (file)
@@ -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 = []