From fa27cfb7a1c6be7e48aed6b3d608b09802f8efc7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 08 2016 15:41:34 +0000 Subject: If the form is not validating and the user is using js return that it's not ok This should help debugging issues with the update_issue endpoint as at the moment it would return a 200 ok when things didn't work (for example the form did not validate). Now instead we will return a 200 notok (that the JS client knows how to handle) and some information about what went wrong. --- diff --git a/pagure/ui/issues.py b/pagure/ui/issues.py index 24ebf97..1a291a7 100644 --- a/pagure/ui/issues.py +++ b/pagure/ui/issues.py @@ -305,6 +305,9 @@ def update_issue(repo, issueid, username=None, namespace=None): APP.logger.exception(err) if not is_js: flask.flash(str(err), 'error') + else: + if is_js: + return 'notok: %s' % form.errors if is_js: return 'ok'