diff --git a/rhodecode/model/users_group.py b/rhodecode/model/users_group.py --- a/rhodecode/model/users_group.py +++ b/rhodecode/model/users_group.py @@ -146,5 +146,6 @@ class UsersGroupModel(BaseModel): obj = UsersGroupToPerm.query()\ .filter(UsersGroupToPerm.users_group == users_group)\ - .filter(UsersGroupToPerm.permission == perm).one() - self.sa.delete(obj) + .filter(UsersGroupToPerm.permission == perm).scalar() + if obj: + self.sa.delete(obj)