From cd4608f3d42fe029a4d54b3861bda502d10047d9 Mon Sep 17 00:00:00 2001 From: Eemeli Ranta Date: Tue, 5 Nov 2024 10:32:29 +0200 Subject: [PATCH] Fix the rank migration not updating the rank field for 0 or none valaues --- tilavarauspalvelu/migrations/0028_fix_rank_fields.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tilavarauspalvelu/migrations/0028_fix_rank_fields.py b/tilavarauspalvelu/migrations/0028_fix_rank_fields.py index f3c9c0473..e524d7bd2 100644 --- a/tilavarauspalvelu/migrations/0028_fix_rank_fields.py +++ b/tilavarauspalvelu/migrations/0028_fix_rank_fields.py @@ -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"])