Skip to content

Commit 5ece8a6

Browse files
committed
fixed sshwsfc#176 bug
1 parent ba71b84 commit 5ece8a6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

xadmin/plugins/inline.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ def get_error_list(self, errors):
409409

410410
def get_form_layout(self, layout):
411411
allow_blank = isinstance(self.admin_view, DetailAdminView)
412-
fs = dict(
413-
[(f.model, InlineFormset(f, allow_blank)) for f in self.formsets])
412+
# fixed #176 bug, change dict to list
413+
fs = [(f.model, InlineFormset(f, allow_blank)) for f in self.formsets]
414414
replace_inline_objects(layout, fs)
415415

416416
if fs:
@@ -420,8 +420,9 @@ def get_form_layout(self, layout):
420420
if not container:
421421
container = layout
422422

423-
for fs in fs.values():
424-
container.append(fs)
423+
# fixed #176 bug, change dict to list
424+
for key, value in fs:
425+
container.append(value)
425426

426427
return layout
427428

0 commit comments

Comments
 (0)