summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-11-13 13:11:21 -0500
committerluxagraf <sng@luxagraf.net>2020-11-13 13:11:21 -0500
commit2f9701b600493f1172c15447ba5ce4f363b49136 (patch)
treedec3b0d1a74395c2bafb9dd4bfe8b8ca35dff834 /app
parent501e8f37c0e4aeb7b4a7f82f91151a9f4a8354fc (diff)
fixed a bug in how lat/lon are returned in posts without a point
Diffstat (limited to 'app')
-rw-r--r--app/posts/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/posts/models.py b/app/posts/models.py
index 5829fe9..838e269 100644
--- a/app/posts/models.py
+++ b/app/posts/models.py
@@ -135,12 +135,14 @@ class Post(models.Model):
@property
def longitude(self):
'''Get the site's longitude.'''
- return self.point.x
+ if self.point:
+ return self.point.x
@property
def latitude(self):
'''Get the site's latitude.'''
- return self.point.y
+ if self.point:
+ return self.point.y
@property
def sitemap_priority(self):