diff options
| author | Julien Phalip <jphalip@gmail.com> | 2012-06-16 17:18:23 -0700 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2012-06-16 17:18:23 -0700 |
| commit | d708298184f8e19f250d2cee5bb900e496ed1175 (patch) | |
| tree | c55c3bc5c687f7fd820abfecbc477893048bf0e2 | |
| parent | fadcc6ddb7f5dfde14fd80497b21076cadae927f (diff) | |
Fixed #18420 -- Prevented the admin JS from crashing when the main form contains no field. Thanks to maciej.maciaszek for the report and patch.
| -rw-r--r-- | django/contrib/admin/templates/admin/change_form.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index ead37b187f..e455793f68 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -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 %} |
