If there is no media_data row for the current media (for
whatever reason, there might be good ones), let
MediaEntry.media_data not raise an exception but just
return None.
The exif display part now handles this by checking whether
.media_data.exif is defined (None has no attribute exif, so
it's undefined, all fine).
session = Session()
return session.query(self.media_data_table).filter_by(
- media_entry=self.id).one()
+ media_entry=self.id).first()
def media_data_init(self, **kwargs):
"""
#}
{% block exif_content %}
- {% if media.media_data.has_key('exif')
- and app_config['exif_visible']
+ {% if app_config['exif_visible']
+ and media.media_data.exif is defined
and media.media_data.exif.has_key('useful') %}
<h3 class="sidedata">EXIF</h3>
<table>