Skip to content

Commit

Permalink
#4141 fixes is_staff and is_active setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers authored and joemull committed Apr 30, 2024
1 parent 8109c54 commit 202b214
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 3 additions & 9 deletions src/api/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,19 @@ def setUpTestData(cls):
roles=['author'],
journal=cls.journal,
is_staff=True,
atrrs={
'is_active': True,
}
is_active=True,
)
cls.editor = helpers.create_user(
username='[email protected]',
roles=['editor'],
journal=cls.journal,
atrrs={
'is_active': True,
}
is_active=True,
)
cls.average_user = helpers.create_user(
'[email protected]',
roles=['author'],
journal=cls.journal,
attrs={
'is_active': True,
}
is_active=True,
)
helpers.create_roles(
['journal-manager'],
Expand Down
4 changes: 1 addition & 3 deletions src/utils/testing/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from cms import models as cms_models


def create_user(username, roles=None, journal=None, is_staff=False, **attrs):
def create_user(username, roles=None, journal=None, **attrs):
"""
Creates a user with the specified permissions.
:username: A unique username to set the user username and email
Expand Down Expand Up @@ -64,8 +64,6 @@ def create_user(username, roles=None, journal=None, is_staff=False, **attrs):
for attr, value in attrs.items():
setattr(user, attr, value)

user.is_staff = is_staff

user.save()

return user
Expand Down

0 comments on commit 202b214

Please sign in to comment.