def post(self):
""" Assign a scheduling task """
s = Schedule2.query\
.join(Role)\
.join(Location)\
.join(Organization)\
.filter(Schedule2.state == "mobius-queue", Organization.active == True)\
.order_by(asc(Schedule2.last_update))\
.first()
if s is None:
abort(404)
s.transition_to_mobius_processing()
role = Role.query.get(s.role_id)
loc = Location.query.get(role.location_id)
return {
"schedule_id": s.id,
"role_id": role.id,
"location_id": loc.id,
"organization_id": loc.organization_id,
}
评论列表
文章目录