check for latitude and longitude before accessing them (#68)
This commit is contained in:
committed by
Thomas Sileo
parent
3c4b9e7379
commit
657ab68355
@@ -263,6 +263,7 @@ def has_place(note):
|
|||||||
def get_place(note):
|
def get_place(note):
|
||||||
if note.get("location") and note["location"].get("type") == "Place":
|
if note.get("location") and note["location"].get("type") == "Place":
|
||||||
tag = note["location"]
|
tag = note["location"]
|
||||||
|
if tag.get("latitude") and tag.get("longitude"):
|
||||||
lat = tag["latitude"]
|
lat = tag["latitude"]
|
||||||
lng = tag["longitude"]
|
lng = tag["longitude"]
|
||||||
out = ""
|
out = ""
|
||||||
@@ -281,6 +282,8 @@ def get_place(note):
|
|||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
@filters.app_template_filter()
|
@filters.app_template_filter()
|
||||||
def poll_answer_key(choice: str) -> str:
|
def poll_answer_key(choice: str) -> str:
|
||||||
|
Reference in New Issue
Block a user