hobo_notify: sync is_staff with is_superuser (#15977)

This commit is contained in:
Thomas NOËL 2017-04-24 16:03:41 +02:00 committed by Frédéric Péters
parent 0db782e086
commit 4643f93bbc
2 changed files with 3 additions and 0 deletions

View File

@ -110,6 +110,7 @@ class Command(BaseCommand):
user.email = o['email'][:75]
user.username = o['uuid'][:30]
user.is_superuser = o['is_superuser']
user.is_staff = o['is_superuser']
user.save()
role_uuids = [role['uuid'] for role in o.get('roles', [])]
provision_user_groups(user, role_uuids)

View File

@ -274,6 +274,7 @@ def test_provision_users(tenants):
assert user.last_name == 'Doe'
assert user.email == 'john.doe@example.net'
assert user.is_superuser is False
assert user.is_staff is False
assert user.saml_identifiers.count() == 1
usi = user.saml_identifiers.get()
assert usi.issuer == 'http://idp.example.net/idp/saml/metadata'
@ -326,6 +327,7 @@ def test_provision_users(tenants):
assert user.last_name == 'Doe'
assert user.email == 'john.doe@example.net'
assert user.is_superuser is True
assert user.is_staff is True
assert user.saml_identifiers.count() == 1
usi = user.saml_identifiers.get()
assert usi.issuer == 'http://idp.example.net/idp/saml/metadata'