mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Do not require an admin password on upgrade.
This commit makes us only require an admin password if there is a new admin user.
This commit is contained in:
parent
fcc7d3d7b1
commit
6f09bb16ba
22
awx/main/management/commands/user_exists.py
Normal file
22
awx/main/management/commands/user_exists.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2014 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
import sys
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""A command that reports whether a username exists within the
|
||||
system or not.
|
||||
"""
|
||||
def handle(self, *args, **options):
|
||||
any_not_found = False
|
||||
|
||||
for username in args:
|
||||
if User.objects.filter(username=username).count():
|
||||
print('User %s exists.' % username)
|
||||
else:
|
||||
print('User %s does not exist.' % username)
|
||||
any_not_found = True
|
||||
Loading…
x
Reference in New Issue
Block a user