def update_queue(consumer=None): """Make sure all builds in the database that are still queued are actually queued in the BuildConsumer.""" if consumer is None: consumer = _consumer with models.session(): for build in select(x for x in Build if x.status == Build.Status_Queued): enqueue(build) for build in select(x for x in Build if x.status == Build.Status_Building): if not consumer.is_running(build): build.status = Build.Status_Stopped
def users(): if not request.user.can_manage: return abort(403) users = select(x for x in User) return render_template('users.html', user=request.user, users=users)
def repositories(): repositories = select(x for x in Repository).order_by(Repository.name) return render_template('repositories.html', user=request.user, repositories=repositories)
def dashboard(): context = {} context['builds'] = select(x for x in Build).order_by( desc(Build.date_queued)).limit(10) context['user'] = request.user return render_template('dashboard.html', **context)