Skip to content

Commit

Permalink
Fix the rank migration not updating the rank field for 0 or none valaues
Browse files Browse the repository at this point in the history
  • Loading branch information
ranta committed Nov 5, 2024
1 parent 6efda50 commit cd4608f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tilavarauspalvelu/migrations/0028_fix_rank_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def forwards_func(apps, schema_editor):

objs = []
for i, obj in enumerate(qs, start=max_rank + 1):
objs.append(obj)
obj.rank = i

model.objects.bulk_update(objs, ["rank"])
Expand Down

0 comments on commit cd4608f

Please sign in to comment.