flame: code simplification

This commit is contained in:
Jakub Jezek 2022-02-24 11:51:54 +01:00
parent 93b8366e60
commit 93f64acff0
No known key found for this signature in database
GPG key ID: D8548FBF690B100A

View file

@ -392,10 +392,7 @@ class FtrackEntityOperator:
query = '{} where name is "{}" and project_id is "{}"'.format(
type, name, self.project_entity["id"])
try:
entity = session.query(query).one()
except Exception:
entity = None
entity = session.query(query).first()
# if entity doesnt exist then create one
if not entity: