non expistent capabilities are not available
This commit is contained in:
parent
53502a27ab
commit
c67f7c122b
1 changed files with 1 additions and 2 deletions
|
@ -436,8 +436,7 @@ def has_capability(user, capability):
|
||||||
level = 'guest'
|
level = 'guest'
|
||||||
else:
|
else:
|
||||||
level = user.profile.get_level()
|
level = user.profile.get_level()
|
||||||
return level in settings.CONFIG['capabilities'][capability] \
|
return settings.CONFIG['capabilities'].get(capability, {}).get(level)
|
||||||
and settings.CONFIG['capabilities'][capability][level]
|
|
||||||
|
|
||||||
def merge_users(old, new):
|
def merge_users(old, new):
|
||||||
old.annotations.all().update(user=new)
|
old.annotations.all().update(user=new)
|
||||||
|
|
Loading…
Reference in a new issue