Commit 9468b86a authored by Enrico Zini's avatar Enrico Zini
Browse files

Forgot to add template tags

parent 49973aa8
from django import template
from backend import const
register = template.Library()
@register.filter
def editable_by(value, arg):
return value.can_be_edited(arg)
@register.filter
def is_admin(value):
# Make sure we work with an AM
if hasattr(value, "am_or_none"):
value = value.am_or_none
if value is None:
return False
return value.is_fd or value.is_dam
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment