Commits

Guilherme Gondim committed b009e35

Use entry-preview URL when entry is not visible

Comments (0)

Files changed (1)

 
     @models.permalink
     def get_absolute_url(self):
-        return ('diario:entry-detail', None, {
-            'pk': self.pk,
-            'slug': self.slug
-        })
+        if self.is_visible():
+            return ('diario:entry-detail', None, {
+                'pk': self.pk,
+                'slug': self.slug
+            })
+        return ('diario:entry-preview', None, {'pk': self.pk})
 
     @models.permalink
     def get_preview_url(self):