don't reset order on republish
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 11 Feb 2013 11:41:00 +0000 (12:41 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 11 Feb 2013 11:41:00 +0000 (12:41 +0100)
catalogue/models.py

index 46d026c..916c5b1 100644 (file)
@@ -111,7 +111,7 @@ class Lesson(models.Model):
         try:
             lesson = cls.objects.get(slug=slug)
         except cls.DoesNotExist:
         try:
             lesson = cls.objects.get(slug=slug)
         except cls.DoesNotExist:
-            lesson = cls(slug=slug)
+            lesson = cls(slug=slug, order=0)
 
         lesson.attachment_set.all().delete()
         for att_name, att_file in infile.attachments.items():
 
         lesson.attachment_set.all().delete()
         for att_name, att_file in infile.attachments.items():
@@ -127,7 +127,6 @@ class Lesson(models.Model):
         lesson.title = wldoc.book_info.title
 
         lesson.level = Level.objects.get(slug=wldoc.book_info.audience)
         lesson.title = wldoc.book_info.title
 
         lesson.level = Level.objects.get(slug=wldoc.book_info.audience)
-        lesson.order = 0
         lesson.populate_dc()
         lesson.build_html()
         lesson.build_package()
         lesson.populate_dc()
         lesson.build_html()
         lesson.build_package()