Skip to content

Commit

Permalink
Fix #402
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeluigi committed Nov 8, 2024
1 parent 8fd33fc commit 4ad5ec0
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 4ad5ec0

Please sign in to comment.