1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 18:08:21 +02:00

Display guests list

This commit is contained in:
Yohann D'ANELLO
2020-03-27 21:18:27 +01:00
parent 0d43d74c60
commit d6e202a26f
4 changed files with 113 additions and 48 deletions

View File

@ -48,6 +48,13 @@ def not_empty_model_change_list(model_name):
return session.get("not_empty_model_change_list_" + model_name) == 1
def has_perm(t, obj, field=None):
print(t)
perm = "." + t + ("__" + field if field else "_")
return PermissionBackend().has_perm(get_current_authenticated_user(), perm, obj)
register = template.Library()
register.filter('not_empty_model_list', not_empty_model_list)
register.filter('not_empty_model_change_list', not_empty_model_change_list)
register.filter('has_perm', has_perm)