From bc495201374529613a475e83899785d6658f8ce3 Mon Sep 17 00:00:00 2001 From: Guillaume Pousseo Date: Mon, 11 Dec 2017 15:47:33 +0100 Subject: [PATCH] Fixing focus on add templates that triggers an error when no id for label isnt set --- setup.py | 2 +- tabbed_admin/templates/tabbed_admin/change_form.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 61b37e2..461fd58 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( name='django-tabbed-admin', - version='1.0.2', + version='1.0.3', author='Guillaume Pousseo', author_email='guillaumepousseo@revsquare.com', description='Easily add tabs to django admin forms.', diff --git a/tabbed_admin/templates/tabbed_admin/change_form.html b/tabbed_admin/templates/tabbed_admin/change_form.html index ebf524b..d7d6be4 100644 --- a/tabbed_admin/templates/tabbed_admin/change_form.html +++ b/tabbed_admin/templates/tabbed_admin/change_form.html @@ -92,7 +92,7 @@ {% block submit_buttons_bottom %}{% submit_row %}{% endblock %} - {% if adminform and add %} + {% if adminform and add and adminform.first_field and adminform.first_field.id_for_label %} {% endif %}