Skip to content

Commit 47098eb

Browse files
committed
Add missing migration
1 parent 1ed246e commit 47098eb

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated by Django 5.2.12 on 2026-04-06 17:10
2+
3+
from django.db import migrations
4+
from django.contrib.auth.models import Group
5+
6+
7+
def assigned_review_migrate_from_partners(apps, schema_editor):
8+
PARTNER_GROUP_NAME = "Partner"
9+
REVIEWER_GROUP_NAME = "Reviewer"
10+
11+
AssignedReviewers = apps.get_model("funds", "AssignedReviewers")
12+
13+
reviewer_id = Group.objects.get(name=REVIEWER_GROUP_NAME).id
14+
15+
if id_qs := Group.objects.filter(name=PARTNER_GROUP_NAME).values_list(
16+
"id", flat=True
17+
):
18+
AssignedReviewers.objects.filter(type_id=id_qs.first()).update(
19+
type_id=reviewer_id
20+
)
21+
22+
23+
class Migration(migrations.Migration):
24+
dependencies = [
25+
("funds", "0133_remove_applicationsubmission_partners"),
26+
]
27+
28+
operations = [migrations.RunPython(assigned_review_migrate_from_partners)]

hypha/apply/users/migrations/0028_remove_partner_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def migrate_partners_to_coapplicants(apps, schema_editor):
1414
class Migration(migrations.Migration):
1515
dependencies = [
1616
("users", "0027_remove_drupal_id_field"),
17-
("funds", "0133_remove_applicationsubmission_partners"),
17+
("funds", "0134_change_partner_assigned_reviewers_role"),
1818
]
1919

2020
operations = [migrations.RunPython(migrate_partners_to_coapplicants)]

0 commit comments

Comments
 (0)