mirror of
https://github.com/django/django.git
synced 2025-01-26 18:19:18 +00:00
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 %}
|
||||
|
||||
{% if adminform and add %}
|
||||
{% if adminform.first_field and add %}
|
||||
<script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>
|
||||
{% endif %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user