No reason for 'ready for publish' check to be in celery, it's synchronous anyway.
[redakcja.git] / apps / cover / models.py
index 87a70a8..14026ac 100644 (file)
@@ -12,6 +12,7 @@ from django.db import models
 from django.db.models.signals import post_save
 from django.dispatch import receiver
 from django.utils.translation import ugettext_lazy as _
+from django.contrib.sites.models import Site
 
 
 class Image(models.Model):
@@ -34,6 +35,9 @@ class Image(models.Model):
     def get_absolute_url(self):
         return ('cover_image', [self.id])
 
+    def get_full_url(self):
+        return "http://%s%s" % (Site.objects.get_current().domain, self.get_absolute_url())
+
 
 @receiver(post_save, sender=Image)
 def download_image(sender, instance, **kwargs):