X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c46844cb5a794566d15437b0c4a809e9230baecf..c51d32b7b97016260e4c60dda9fbbd9eb25420ce:/src/sources/models.py diff --git a/src/sources/models.py b/src/sources/models.py index dd521da0..ed2775ef 100644 --- a/src/sources/models.py +++ b/src/sources/models.py @@ -130,7 +130,7 @@ class BookSource(models.Model): return f'{self.source} -> {self.book}' def get_absolute_url(self): - return reverse('source_book_prepare', args=[self.pk]) + return reverse('source_book_prepare', args=[self.book.pk]) def get_view_files(self): # TODO: won't work for PDFs. @@ -162,6 +162,7 @@ class BookSource(models.Model): if dbook is None: dbook = DBook.create( user, texts[0], + catalogue_book=book, title=book.title, slug=str(uuid.uuid4()), )