-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update boundaries geometry 3 #5787
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5787 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 448 448
Lines 25121 25113 -8
=========================================
- Hits 25121 25113 -8 ☔ View full report in Codecov by Sentry. |
267c7bc
to
7563744
Compare
63f458e
to
91c9f16
Compare
7563744
to
f8998bd
Compare
26831cf
to
e47d080
Compare
temba/api/v2/serializers.py
Outdated
@@ -135,8 +135,8 @@ def get_aliases(self, obj): | |||
return [alias.name for alias in obj.aliases.all()] | |||
|
|||
def get_geometry(self, obj): | |||
if self.context["include_geometry"] and obj.simplified_geometry: | |||
return json.loads(obj.simplified_geometry.geojson) | |||
if self.context["include_geometry"] and obj.geometry: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there such a thing as a location without geometry ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also this method can be simplified to return obj.geometry if self.context["include_geometry"] else None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there such a thing as a location without geometry ?
Just checked on prod and answer is no
temba/locations/models.py
Outdated
@@ -67,7 +67,7 @@ def get_geojson_feature(self): | |||
return geojson.Feature( | |||
properties=dict(name=self.name, osm_id=self.osm_id, id=self.pk, level=self.level), | |||
zoomable=True if self.children.all() else False, | |||
geometry=None if not self.simplified_geometry else geojson.loads(self.simplified_geometry.geojson), | |||
geometry=self.geometry or None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or None
doesn't do anything here...
e47d080
to
ecb09fb
Compare
ecb09fb
to
2f2d35a
Compare
No description provided.