support for spaces in fixed wluri-s
[redakcja.git] / apps / catalogue / models / book.py
index 39f2d0f..a8a3f20 100755 (executable)
@@ -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)
     _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)
 
     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:
                 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)
 
                         update['dc_cover_image'] = image
         Book.objects.filter(pk=self.pk).update(**update)