]> git.parisson.com Git - teleforma.git/commitdiff
fix doc
authoryomguy <yomguy@parisson.com>
Wed, 28 Nov 2012 16:17:01 +0000 (17:17 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 28 Nov 2012 16:17:01 +0000 (17:17 +0100)
teleforma/models/core.py

index 7ca78374efe873f698179e3abfa070df1a5561af..c8f429ba32eff8db393607e05caba5b1dd135f4f 100644 (file)
@@ -440,12 +440,12 @@ class Document(MediaBase):
         return  ' - '.join([unicode(self.course), unicode(types), self.title ])
 
     def save(self, **kwargs):
-        super(Document, self).save(**kwargs)
-        self.course.save()
+        if self.course:
+            self.course.save()
         self.set_mime_type()
         if not self.title:
             self.title = os.path.splitext(os.path.split(self.file.path)[1])[0].replace('-', ' ')
-        super(DocumentSimple, self).save(**kwargs)
+        super(Document, self).save(**kwargs)
 
     class Meta(MetaCore):
         db_table = app_label + '_' + 'document'