template fix (#3704)

fix template error if there is no 'records' in config at all
This commit is contained in:
kulikov-a
2023-12-15 15:09:23 +01:00
committed by GitHub
parent eee355929d
commit 1cd458e891
@@ -5,11 +5,13 @@
{% if domaindb.enabled == '1' and domaindb.type == 'primary' %}
$TTL {{ domaindb.ttl }}
@ IN SOA {{ domaindb.dnsserver }}. {{ domaindb.mailadmin|replace('@', '.') }}. ( {{ domaindb.serial|trim }} {{ domaindb.refresh }} {{ domaindb.retry }} {{ domaindb.expire }} {{ domaindb.negative }} )
{% for record in helpers.sortDictList(OPNsense.bind.record.records.record, 'name', 'type' ) %}
{% if record.domain == domaindb['@uuid'] %}
{% if helpers.exists('OPNsense.bind.record.records.record') %}
{% for record in helpers.sortDictList(OPNsense.bind.record.records.record, 'name', 'type' ) %}
{% if record.domain == domaindb['@uuid'] %}
{{ record.name }} {{ record.type }} {{ record.value }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}