From 1f8736ce1d257024a3c1b754282be0a66a760887 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 31 Aug 2018 10:56:16 -0400 Subject: [PATCH] workflow endpoints should return 401 on invalid credentials if you have a license that doesn't allow use of workflows, invalid credentials yielded an HTTP 402; this commit changes the precedence see: https://github.com/ansible/tower/issues/2950 --- awx/api/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index 8ea54c2f7d..2d73816789 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -135,9 +135,10 @@ class WorkflowsEnforcementMixin(object): Mixin to check that license supports workflows. ''' def check_permissions(self, request): + ret = super(WorkflowsEnforcementMixin, self).check_permissions(request) if not feature_enabled('workflows') and request.method not in ('GET', 'OPTIONS', 'DELETE'): raise LicenseForbids(_('Your license does not allow use of workflows.')) - return super(WorkflowsEnforcementMixin, self).check_permissions(request) + return ret class UnifiedJobDeletionMixin(object):