From 2f9701b600493f1172c15447ba5ce4f363b49136 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Fri, 13 Nov 2020 13:11:21 -0500 Subject: fixed a bug in how lat/lon are returned in posts without a point --- app/posts/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app') 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): -- cgit v1.2.3-70-g09d2