mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
database module: fixed session is not callable and fixed filter_by -> filter (previously raised error)
This commit is contained in:
@@ -68,7 +68,7 @@ class Database(object):
|
||||
self._session = None # Lazilly created..
|
||||
|
||||
def __enter__(self):
|
||||
return self.session()
|
||||
return self.session
|
||||
|
||||
def __exit__(self, *args, **kwargs):
|
||||
self._session.close()
|
||||
@@ -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_by(cls.id==msg['msg']['id'])
|
||||
return session.query(cls).filter(cls.id==msg['msg']['id'])
|
||||
|
||||
def json(self):
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user