DAS2 v2.x appears to assume fields are in Mutable Containers
mkoistinen opened this issue · 1 comments
mkoistinen commented
django-admin-sortable2/adminsortable2/admin.py
Lines 496 to 500 in 7bb2640
This code here makes the assumption that the provided Iterable of fields
is mutable. Tuples are not and Tuples have been the traditional container for declaring fields in Django models for a long time.
Ideally, this would do something more like:
def get_fields(self, *args, **kwargs):
**fields = list(super().get_fields(*args, **kwargs))**
if self.default_order_field not in fields:
fields.append(self.default_order_field)
return fields
jrief commented
Well spotted!
I usually do that anyway, just missed here.