Skip to content

Commit

Permalink
Merge pull request #413 from ldeluigi/master
Browse files Browse the repository at this point in the history
Fix #402
  • Loading branch information
jrief authored Nov 15, 2024
2 parents 8fd33fc + 4ad5ec0 commit 061ef2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adminsortable2/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def save_new(self, form, commit=True):
obj = super().save_new(form, commit=False)

order_field_value = getattr(obj, self.default_order_field, None)
if order_field_value is None or order_field_value >= 0:
if order_field_value is None or order_field_value < 0:
max_order = self.get_max_order()
setattr(obj, self.default_order_field, max_order + 1)
if commit:
Expand Down

0 comments on commit 061ef2d

Please sign in to comment.