non expistent capabilities are not available

This commit is contained in:
j 2025-01-24 19:53:59 +05:30
parent 53502a27ab
commit c67f7c122b

View file

@ -436,8 +436,7 @@ def has_capability(user, capability):
level = 'guest'
else:
level = user.profile.get_level()
return level in settings.CONFIG['capabilities'][capability] \
and settings.CONFIG['capabilities'][capability][level]
return settings.CONFIG['capabilities'].get(capability, {}).get(level)
def merge_users(old, new):
old.annotations.all().update(user=new)