mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 16:29:49 +08:00
database: use .one() instead of .all() + assert
Signed-off-by: Lubos Kocman <lkocman@redhat.com>
This commit is contained in:
@@ -125,7 +125,7 @@ class ModuleBuild(Base):
|
||||
def from_fedmsg(cls, session, msg):
|
||||
if '.module.' not in msg['topic']:
|
||||
raise ValueError("%r is not a module message." % msg['topic'])
|
||||
return session.query(cls).filter(cls.id==msg['msg']['id'])
|
||||
return session.query(cls).filter(cls.id==msg['msg']['id']).one()
|
||||
|
||||
def json(self):
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user