django-grappelli icon indicating copy to clipboard operation
django-grappelli copied to clipboard

drag&drop fails due to validation rule on empty element

Open lsmith77 opened this issue 1 year ago • 3 comments

Django Admin always adds an empty element to my list of relationships (ie. the one with the - at the end in the below screenshot).

image

The problem is that when I save now, the validation rule triggers because of the ordering property being filled.

How can I prevent this?

I would also be fine if I could figure out how to prevent this default empty element from being added to the list of relationships.

lsmith77 avatar Oct 10 '23 17:10 lsmith77

ok figured out I can just set extra = 0 but would still be nice if grappelli would handle this better out of the box (ie. with extra > 0)

lsmith77 avatar Oct 10 '23 17:10 lsmith77

are you sure it's because of the ordering field (because that should not be the case). other fields can be excluded with sortable_excludes.

sehmaschine avatar Dec 14 '23 14:12 sehmaschine

I cannot definitively say so but I tried to quickly reproduce the issue on an inline model without ordering and I was unable to.

lsmith77 avatar Dec 14 '23 20:12 lsmith77

closing this for now. please reopen, if the issue still exists.

sehmaschine avatar Mar 13 '24 13:03 sehmaschine