Select the full RepositoryBuild record
If we just return the ID, then peewee just fills in the other fields with defaults (such as UUID).
This commit is contained in:
parent
80b24494b5
commit
474fffd01f
2 changed files with 13 additions and 3 deletions
|
@ -175,11 +175,12 @@ def get_archivable_build():
|
|||
.alias('candidates'))
|
||||
|
||||
try:
|
||||
return (RepositoryBuild
|
||||
found_id = (RepositoryBuild
|
||||
.select(candidates.c.id)
|
||||
.from_(candidates)
|
||||
.order_by(db_random_func())
|
||||
.get())
|
||||
return RepositoryBuild.get(id=found_id)
|
||||
except RepositoryBuild.DoesNotExist:
|
||||
return None
|
||||
|
||||
|
|
Reference in a new issue