forked from DGNum/gestioCOF
Disambiguation in kfet's permission handling
In some places we used to refer to permissions based on their codename only (the part after the dot "." in the following examples) which can be ambiguous. Typically, we might define permissions like "bds.is_team" or "cof.is_team" in the near future ;)
This commit is contained in:
parent
67e28c704f
commit
64c792b11f
5 changed files with 37 additions and 25 deletions
|
@ -18,7 +18,7 @@ class TestStats(TestCase):
|
|||
user.set_password("foobar")
|
||||
user.save()
|
||||
Account.objects.create(trigramme="FOO", cofprofile=user.profile)
|
||||
perm = Permission.objects.get(codename="is_team")
|
||||
perm = Permission.objects.get_by_natural_key("is_team", "kfet", "account")
|
||||
user.user_permissions.add(perm)
|
||||
|
||||
user2 = User.objects.create(username="Barfoo")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue