From 1ed99862c6215ddcd22b3e7797415afd8d49b8e0 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 25 Oct 2005 01:47:34 +0000 Subject: [PATCH] Fixed #679 -- 'collapse' admin row class is now processed correctly when more than one tuple is in the admin.fields list. Thanks, malcolm git-svn-id: http://code.djangoproject.com/svn/django/trunk@1008 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/views/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 8ecf0a2c97..e3dd5afdcf 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -556,14 +556,14 @@ def _get_template(opts, app_label, add=False, change=False, show_delete=False, f if not seen_collapse and 'collapse' in options.get('classes', ''): seen_collapse = True javascript_imports.append('%sjs/admin/CollapsedFieldsets.js' % ADMIN_MEDIA_PREFIX) - try: - for field_list in options['fields']: + for field_list in options['fields']: + try: for f in field_list: if f.rel and isinstance(f, meta.ManyToManyField) and f.rel.filter_interface: javascript_imports.extend(['%sjs/SelectBox.js' % ADMIN_MEDIA_PREFIX, '%sjs/SelectFilter2.js' % ADMIN_MEDIA_PREFIX]) raise StopIteration - except StopIteration: - break + except StopIteration: + break for j in javascript_imports: t.append('' % j)