Skip to content
Snippets Groups Projects
Commit d66ac21a authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

BUGFIF db.UserRole.is_legal označoval za nelegální všechny role kromě těch s omezením na level

parent 82f53ef0
No related branches found
No related tags found
1 merge request!97Import orgů
......@@ -576,10 +576,10 @@ class UserRole(Base):
# Některé role mají omezení na úroveň hierarchie.
level = self.place.level if self.place else -1
rt = self.role
if not (rt == RoleType.garant and level <= 0
or rt == RoleType.garant_kraj and level == 1
or rt == RoleType.garant_okres and level == 2
or rt == RoleType.garant_skola and level >= 3):
if (rt == RoleType.garant and not level <= 0
or rt == RoleType.garant_kraj and not level == 1
or rt == RoleType.garant_okres and not level == 2
or rt == RoleType.garant_skola and not level >= 3):
return False
return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment