Skip to content

Commit

Permalink
Fix migrations after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
frjo committed Nov 1, 2024
1 parent 048791c commit 125cbf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
26 changes: 0 additions & 26 deletions hypha/apply/projects/migrations/0090_auto_20241018_1430.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Generated by Django 4.2.16 on 2024-10-18 14:29
# Generated by Django 4.2.16 on 2024-11-01 16:27

from django.db import migrations, models
from hypha.apply.users.groups import GROUPS_ORG_FACULTY


def allow_internal_groups_to_contractdocumentcategory(apps, schema_editor):
ContractDocumentCategory = apps.get_model(
"application_projects", "ContractDocumentCategory"
)
Group = apps.get_model("auth", "Group")

groups = Group.objects.filter(name__in=GROUPS_ORG_FACULTY)
for category in ContractDocumentCategory.objects.all():
# Add the default groups to the document_access_view field
category.document_access_view.add(*groups)


class Migration(migrations.Migration):
dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
("application_projects", "0088_remove_duediligencedocument_vendor_and_more"),
("application_projects", "0089_projectreminderfrequency"),
]

operations = [
Expand All @@ -24,4 +37,5 @@ class Migration(migrations.Migration):
verbose_name="Allow document access for groups",
),
),
migrations.RunPython(allow_internal_groups_to_contractdocumentcategory),
]

0 comments on commit 125cbf0

Please sign in to comment.