Browse Source

Change lat, lon properties to return None

Slight code simplification, allowing get() to
return None when the field is missing. The related
if statement in Jinja2 accepts None as False.

Co-authored-by: Simon Conseil <contact@saimon.org>
pull/525/head
Stasinos Konstantopoulos 1 year ago
parent
commit
664fd0a994
  1. 7
      src/sigal/gallery.py

7
src/sigal/gallery.py

@ -289,12 +289,13 @@ class Image(Media):
@cached_property
def lat(self):
return self.markdown_metadata.get("lat", {})
"""If not `None`, latitude extracted from the Markdown index.md file."""
return self.markdown_metadata.get("lat")
@cached_property
def lon(self):
"""Other metadata extracted from the Markdown index.md file."""
return self.markdown_metadata.get("lon", {})
"""If not `None`, longitude extracted from the Markdown index.md file."""
return self.markdown_metadata.get("lon")
@cached_property
def raw_exif(self):

Loading…
Cancel
Save