Save this assignment until it's needed.

This commit is contained in:
voussoir 2018-12-21 23:44:50 -08:00
parent d736c81100
commit c6c6158062

View file

@ -1414,11 +1414,11 @@ class PhotoDB(
thing_table = thing_map['table']
thing_class = thing_map['class']
thing_cache = self.caches[thing_type]
thing_index = constants.SQL_INDEX[thing_table]
if isinstance(db_row, dict):
thing_id = db_row['id']
else:
thing_index = constants.SQL_INDEX[thing_table]
thing_id = db_row[thing_index['id']]
try: