Skip to content

Commit bd2ff0b

Browse files
morsikjleclanche
authored andcommitted
Fix multi-fields in single line
1 parent b2d3ab7 commit bd2ff0b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

polymorphic/admin/childadmin.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,15 @@ def get_subclass_fields(self, request, obj=None):
227227

228228
# Find which fields are not part of the common fields.
229229
for fieldset in self.get_base_fieldsets(request, obj):
230-
for field in fieldset[1]["fields"]:
230+
# multiple elements in single line
231+
if isinstance(field, tuple):
232+
for line_field in field:
233+
try:
234+
subclass_fields.remove(line_field)
235+
except ValueError:
236+
pass # field not found in form, Django will raise exception later.
237+
else:
238+
# regular one-element-per-line
231239
try:
232240
subclass_fields.remove(field)
233241
except ValueError:

0 commit comments

Comments
 (0)