publishable in save dialog
[redakcja.git] / apps / catalogue / models / book.py
index 2a0d552..8c9e6e6 100755 (executable)
@@ -72,6 +72,11 @@ class Book(models.Model):
     def get_absolute_url(self):
         return ("catalogue_book", [self.slug])
 
     def get_absolute_url(self):
         return ("catalogue_book", [self.slug])
 
+    def correct_about(self):
+        return "http://%s%s" % (
+            Site.objects.get_current().domain,
+            self.get_absolute_url()
+        )
 
     # Creating & manipulating
     # =======================
 
     # Creating & manipulating
     # =======================
@@ -198,7 +203,7 @@ class Book(models.Model):
             chunk.commit('')
 
         for i in range(len(other)):
             chunk.commit('')
 
         for i in range(len(other)):
-            self[i].prepend_history(other[i])
+            self[i].prepend_history(other[0])
 
         assert not other.chunk_set.exists()
         other.delete()
 
         assert not other.chunk_set.exists()
         other.delete()
@@ -230,7 +235,7 @@ class Book(models.Model):
         except ValidationError, e:
             raise AssertionError(_('Invalid Dublin Core') + ': ' + str(e))
 
         except ValidationError, e:
             raise AssertionError(_('Invalid Dublin Core') + ': ' + str(e))
 
-        valid_about = "http://%s%s" % (Site.objects.get_current().domain, self.get_absolute_url())
+        valid_about = self.correct_about()
         assert bi.about == valid_about, _("rdf:about is not") + " " + valid_about
 
     def hidden(self):
         assert bi.about == valid_about, _("rdf:about is not") + " " + valid_about
 
     def hidden(self):