Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
commit 1084d9202648d408bbc66bee5e1923ddb692bdb9 Author: Bohuslav Kabrda bkabrda@redhat.com Date: Wed Feb 20 13:58:17 2013 +0100
Create a backend view that will render waiting actions
.../coprs/views/backend_ns/backend_general.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/coprs_frontend/coprs/views/backend_ns/backend_general.py b/coprs_frontend/coprs/views/backend_ns/backend_general.py index c51fcb6..f6ce69a 100644 --- a/coprs_frontend/coprs/views/backend_ns/backend_general.py +++ b/coprs_frontend/coprs/views/backend_ns/backend_general.py @@ -1,6 +1,7 @@ import flask
from coprs import db +from coprs import helpers from coprs import models
from coprs.logic import builds_logic @@ -40,3 +41,9 @@ def update_builds(): db.session.commit()
return flask.jsonify({'updated_builds_ids': list(existing.keys()), 'non_existing_builds_ids': non_existing_ids}) + +@backend_ns.route('/waiting_actions/') +def waiting_actions(): + actions = models.Action.query.filter(models.Action.backend_result==helpers.BackendResultEnum('waiting')).all() + + return flask.jsonify({'actions': [action.to_dict(options={'__columns_except__': ['backend_result', 'backend_message']}) for action in actions]})
copr-devel@lists.fedorahosted.org