X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/19e20c4e4b6a7940977a293698d61e75810ff321..37dab8f9ef681bfba763ee4f279c9babd49de783:/apps/catalogue/models/book.py?ds=sidebyside diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 39f2d0f4..a8a3f20c 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -40,7 +40,8 @@ class Book(models.Model): _new_publishable = models.NullBooleanField(editable=False) _published = models.NullBooleanField(editable=False) _on_track = models.IntegerField(null=True, blank=True, db_index=True, editable=False) - dc_cover_image = models.ForeignKey(Image, blank=True, null=True, db_index=True, on_delete=models.SET_NULL) + dc_cover_image = models.ForeignKey(Image, blank=True, null=True, + db_index=True, on_delete=models.SET_NULL, editable=False) dc_slug = models.CharField(max_length=128, null=True, blank=True, editable=False, db_index=True) @@ -343,7 +344,7 @@ class Book(models.Model): except: pass else: - if info.cover_source == image.get_absolute_url(): + if info.cover_source == image.get_full_url(): update['dc_cover_image'] = image Book.objects.filter(pk=self.pk).update(**update)