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:
Julien Phalip 2012-06-16 17:18:23 -07:00
parent fadcc6ddb7
commit d708298184
1 changed files with 1 additions and 1 deletions

View File

@ -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 %}