hobo_notify: set is_active attribute (#42428)
This commit is contained in:
parent
3a2b8d45e4
commit
4ef65f9947
|
@ -515,6 +515,7 @@ def test_process_notification_user_provision(pub):
|
|||
u'email': u'john.doe@example.net',
|
||||
u'zipcode': u'13400',
|
||||
u'is_superuser': False,
|
||||
'is_active': True,
|
||||
u'roles': [
|
||||
{
|
||||
u'uuid': u'12345',
|
||||
|
@ -543,6 +544,7 @@ def test_process_notification_user_provision(pub):
|
|||
assert user.form_data['_birthdate'] is None
|
||||
assert user.name_identifiers == ['a'*32]
|
||||
assert user.is_admin is False
|
||||
assert user.is_active is True
|
||||
assert set(user.roles) == set([new_role.id, old_role.id])
|
||||
|
||||
notification = {
|
||||
|
@ -560,6 +562,7 @@ def test_process_notification_user_provision(pub):
|
|||
u'zipcode': u'13600',
|
||||
u'birthdate': u'2000-01-01',
|
||||
u'is_superuser': True,
|
||||
'is_active': False,
|
||||
u'roles': [
|
||||
{
|
||||
u'uuid': u'xyz',
|
||||
|
@ -588,6 +591,7 @@ def test_process_notification_user_provision(pub):
|
|||
assert user.form_data['_birthdate'].tm_year == 2000
|
||||
assert user.name_identifiers == ['a'*32]
|
||||
assert user.is_admin is True
|
||||
assert user.is_active is False
|
||||
assert set(user.roles) == set([old_role.id])
|
||||
|
||||
for birthdate in ('baddate', '', None):
|
||||
|
|
|
@ -191,6 +191,7 @@ class CmdHoboNotify(Command):
|
|||
user.form_data[field.id] = field_value
|
||||
user.name_identifiers = [uuid]
|
||||
# reset roles
|
||||
user.is_active = o.get('is_active', True)
|
||||
user.is_admin = o.get('is_superuser', False)
|
||||
user.roles = []
|
||||
for role_ref in o.get('roles', []):
|
||||
|
|
Loading…
Reference in New Issue