Browse Source

Make Entry.get_absolute_url actually return an absolute URL, always

tags/v1.9.5
Danielle McLean 1 year ago
parent
commit
6fb289727c
Signed by: Danielle McLean <dani@00dani.me> GPG Key ID: 5A5D2D1AFF12EEC5
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      entries/models.py

+ 2
- 1
entries/models.py View File

@@ -131,7 +131,8 @@ class Entry(ModelMeta, TimeStampedModel):
131 131
         return '{0} {1}: {2}'.format(self.kind, self.id, self.title)
132 132
 
133 133
     def get_absolute_url(self):
134
-        return self.url
134
+        base = 'https://' + Site.objects.get_current().domain
135
+        return urljoin(base, self.url)
135 136
 
136 137
     @property
137 138
     def url(self):

Loading…
Cancel
Save