]> git.parisson.com Git - teleforma.git/commitdiff
fix various super calls
authoryomguy <yomguy@parisson.com>
Wed, 20 Feb 2013 12:05:30 +0000 (13:05 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 20 Feb 2013 12:05:30 +0000 (13:05 +0100)
teleforma/models/core.py

index 144dabe9257e11641363930c8c959f21c1a87b54..1422dc7be905c95c193d64b1b5b47c817870c658 100755 (executable)
@@ -386,12 +386,13 @@ class Document(MediaBase):
         return ' - '.join(strings)
 
     def save(self, **kwargs):
+        super(Document, self).save(**kwargs)
         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(Document, self).save(**kwargs)
+
 
     class Meta(MetaCore):
         db_table = app_label + '_' + 'document'
@@ -445,12 +446,13 @@ class Media(MediaBase):
         return ' - '.join(strings)
 
     def save(self, **kwargs):
+        super(Media, self).save(**kwargs)
         if self.course:
             self.course.save()
         elif self.conference:
             self.conference.course.save()
         self.set_mime_type()
-        super(Media, self).save(**kwargs)
+
 
 
     class Meta(MetaCore):
@@ -518,8 +520,8 @@ class Conference(Displayable):
         return ' - '.join(list)
 
     def save(self, **kwargs):
-        self.course.save()
         super(Conference, self).save(**kwargs)
+        self.course.save()
 
 
     def to_dict(self):