wip/72777-publik-django-templatetags (#72777) #17

Merged
fpeters merged 2 commits from wip/72777-publik-django-templatetags into main 2022-12-26 09:33:02 +01:00
4 changed files with 6 additions and 11 deletions

1
debian/control vendored
View File

@ -26,6 +26,7 @@ Depends: python3-cmislib,
python3-lxml,
python3-pdfrw,
python3-pil,
python3-publik-django-templatetags,
python3-pycryptodome,
python3-pyexcel-io,
python3-pyexcel-ods,

View File

@ -286,17 +286,6 @@ def render_body_schemas(body_schemas):
return mark_safe(s)
@register.filter(name='get')
def get(obj, key):
try:
return obj.get(key)
except AttributeError:
try:
return obj[key]
except (IndexError, KeyError, TypeError):
return None
@register.filter
def json_dumps(d):
return json.dumps(d, indent=2)

View File

@ -102,6 +102,9 @@ TEMPLATES = [
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
],
'builtins': [
'publik_django_templatetags.publik.templatetags.publik',
],
},
},
]

View File

@ -49,6 +49,7 @@ deps =
codestyle: pre-commit
ldaptools
python-ldap<=3.2 # align with Debian <= 11 (buster, bullseye)
git+https://git.entrouvert.org/publik-django-templatetags.git
commands =
./get_wcs.sh
py.test {posargs: --numprocesses {env:NUMPROCESSES:1} --dist loadfile {env:FAST:} {env:COVERAGE:} {env:JUNIT:} tests/}
@ -85,5 +86,6 @@ deps =
responses
mohawk
ldaptools
git+https://git.entrouvert.org/publik-django-templatetags.git
commands =
./pylint.sh passerelle/ tests/