mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-11-27 22:25:08 +08:00
Another classmethod to query with, and a bugfix!
This commit is contained in:
@@ -180,6 +180,11 @@ class ModuleBuild(Base):
|
||||
backend=conf.messaging,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def by_state(cls, session, state):
|
||||
return session.query(rida.database.ModuleBuild)\
|
||||
.filter_by(state=BUILD_STATES[state]).all()
|
||||
|
||||
@classmethod
|
||||
def get_active_by_koji_tag(cls, session, koji_tag):
|
||||
""" Find the ModuleBuilds in our database that should be in-flight...
|
||||
@@ -189,7 +194,7 @@ class ModuleBuild(Base):
|
||||
"""
|
||||
query = session.query(rida.database.ModuleBuild)\
|
||||
.filter_by(koji_tag=koji_tag)\
|
||||
.filter_by(state="build")
|
||||
.filter_by(state=BUILD_STATES["build"])
|
||||
|
||||
count = query.count()
|
||||
if count > 1:
|
||||
|
||||
Reference in New Issue
Block a user