Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SortableStackedInlineBase fails if the fields is defined as a tuple #302

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion suit/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,15 @@ def get_fieldsets(self, *args, **kwargs):
for line in fieldset:
if not line or not isinstance(line, dict):
continue

fields = line.get('fields')

# Some use tuples for fields however they are immutable
assert isinstance(fields, tuple), "The fields attribute of your " \
"Inline is a tuple. This must be " \
"list as we may need to modify " \
"it and tuples are immutable."

if self.sortable in fields:
fields.remove(self.sortable)

Expand Down