]> git.parisson.com Git - teleforma.git/commitdiff
fix no category
authoryomguy <yomguy@parisson.com>
Sun, 15 Apr 2012 22:22:23 +0000 (00:22 +0200)
committeryomguy <yomguy@parisson.com>
Sun, 15 Apr 2012 22:22:23 +0000 (00:22 +0200)
teleforma/models.py

index 28a02a4c0d2f4284cd946c7881e3f71a6a2f712f..2322afc1986338bfbf71e8dbbfa5fd7317e438d5 100755 (executable)
@@ -307,7 +307,10 @@ class Training(Model):
     obligation      = BooleanField(_('obligation'))
 
     def __unicode__(self):
-        return self.code + ' - ' + self.category.name
+        code = self.code
+        if self.category:
+            code += ' - ' + self.category.name
+        return code
 
     class Meta:
         db_table = app_label + '_' + 'training'