X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c601bf6ac7304192cac242965217b7c089f37f8d..3c6f3da036cb8376cef931b3d4d5e354aff473d9:/apps/catalogue/models/book.py diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 2a0d552f..8c9e6e6a 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -72,6 +72,11 @@ class Book(models.Model): 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 # ======================= @@ -198,7 +203,7 @@ class Book(models.Model): 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() @@ -230,7 +235,7 @@ class Book(models.Model): 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):