Merge branch 'dk/1091-dnssec' of https://github.com/cisagov/getgov into dk/1091-dnssec

This commit is contained in:
Rachid Mrad 2023-10-05 16:29:35 -04:00
commit afdc922b13
No known key found for this signature in database
GPG key ID: EF38E4CEC4A8F3CF
3 changed files with 7 additions and 2 deletions

View file

@ -34,7 +34,7 @@
>
DNSSEC
</a>
{% if domain.dnssec_enabled %}
{% if domain.dnssecdata is not None or request.path|startswith:url and request.path|endswith:'data' %}
<ul class="usa-sidenav__sublist">
<li class="usa-sidenav__item">
{% url 'domain-dns-dnssec-dsdata' pk=domain.id as url %}

View file

@ -149,7 +149,7 @@ def input_with_errors(context, field=None): # noqa: C901
# see Widget.get_context() on
# https://docs.djangoproject.com/en/4.1/ref/forms/widgets
widget = field.field.widget.get_context(
field.html_name, field.value() or field.initial, field.build_widget_attrs(attrs)
field.html_name, field.value(), field.build_widget_attrs(attrs)
) # -> {"widget": {"name": ...}}
context["widget"] = widget["widget"]

View file

@ -18,6 +18,11 @@ def startswith(text, starts):
return text.startswith(starts)
return False
@register.filter("endswith")
def endswith(text, ends):
if isinstance(text, str):
return text.endswith(ends)
return False
@register.simple_tag
def public_site_url(url_path):