Fixed #18420 -- Prevented the admin JS from crashing when the main form contains no field. Thanks to maciej.maciaszek for the report and patch.
This commit is contained in:
parent
fadcc6ddb7
commit
d708298184
|
@ -65,7 +65,7 @@
|
||||||
|
|
||||||
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
|
{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
|
||||||
|
|
||||||
{% if adminform and add %}
|
{% if adminform.first_field and add %}
|
||||||
<script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>
|
<script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue