From 46ef0475d46b137be5c9804a85da0a12a452a36d Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Thu, 20 Nov 2014 10:53:15 -0600 Subject: [PATCH] Allow string "false" to mean False on is_superuser --- 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 339102faf6..a4af5c8e15 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -444,7 +444,8 @@ def disallow_superuser_escalation(cls): @functools.wraps(method) def fx(self, request, *a, **kw): if not request.user.is_superuser: - if request.DATA.get('is_superuser', False): + is_su = request.DATA.get('is_superuser', False) + if su and su != 'false': raise PermissionDenied('Only superusers may create ' 'other superusers.') return method(self, request, *a, **kw)