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:
Joseph Schorr 2015-09-09 21:43:48 -04:00
parent 80b24494b5
commit 474fffd01f
2 changed files with 13 additions and 3 deletions

View file

@ -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