Skip to content

Commit b678eb0

Browse files
committed
Fix role property naming
1 parent 4bbf4ec commit b678eb0

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/app/domain/enums/user_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def is_assignable(self) -> bool:
1111
return self != UserRole.SUPER_ADMIN
1212

1313
@property
14-
def is_modifiable(self) -> bool:
14+
def is_changeable(self) -> bool:
1515
return self != UserRole.SUPER_ADMIN

src/app/domain/services/user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ def toggle_user_activation(self, user: User, *, is_active: bool) -> None:
6060
"""
6161
:raises ActivationChangeNotPermitted:
6262
"""
63-
if not user.role.is_modifiable:
63+
if not user.role.is_changeable:
6464
raise ActivationChangeNotPermittedError(user.username, user.role)
6565
user.is_active = is_active
6666

6767
def toggle_user_admin_role(self, user: User, *, is_admin: bool) -> None:
6868
"""
6969
:raises RoleChangeNotPermitted:
7070
"""
71-
if not user.role.is_modifiable:
71+
if not user.role.is_changeable:
7272
raise RoleChangeNotPermittedError(user.username, user.role)
7373
user.role = UserRole.ADMIN if is_admin else UserRole.USER

tests/app/unit/domain/enums/test_user_role.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ def test_assignability(role: UserRole, expected: bool) -> None:
2323
(UserRole.SUPER_ADMIN, False),
2424
],
2525
)
26-
def test_modifiability(role: UserRole, expected: bool) -> None:
27-
assert role.is_modifiable is expected
26+
def test_changeability(role: UserRole, expected: bool) -> None:
27+
assert role.is_changeable is expected

0 commit comments

Comments
 (0)