From 1fbb50dbb248210775e723bc8ad63117504d7b3e Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Mon, 13 Jan 2025 13:06:36 -0500 Subject: [PATCH] fix migrations and admin institutional permissions problems --- admin/institutions/views.py | 3 ++- ...y => 0025_institutional_request_access_enabled_and_more.py} | 0 ...more.py => 0026_add_is_institutional_request_is_curator.py} | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) rename osf/migrations/{0025_contributor_is_curator_and_more.py => 0025_institutional_request_access_enabled_and_more.py} (100%) rename osf/migrations/{0026_contributor_is_curator_and_more.py => 0026_add_is_institutional_request_is_curator.py} (89%) diff --git a/admin/institutions/views.py b/admin/institutions/views.py index 2c7286fe242..2c7f399ae68 100644 --- a/admin/institutions/views.py +++ b/admin/institutions/views.py @@ -255,8 +255,9 @@ def form_valid(self, form): if not osf_user: raise Http404(f'OSF user with id "{user_id}" not found. Please double check.') - group = Group.objects.filter(name__startswith=f'institution_{target_institution._id}').first() + osf_user.add_or_update_affiliated_institution(target_institution) + group = Group.objects.filter(name__startswith=f'institution_{target_institution._id}').first() group.user_set.add(osf_user) group.save() diff --git a/osf/migrations/0025_contributor_is_curator_and_more.py b/osf/migrations/0025_institutional_request_access_enabled_and_more.py similarity index 100% rename from osf/migrations/0025_contributor_is_curator_and_more.py rename to osf/migrations/0025_institutional_request_access_enabled_and_more.py diff --git a/osf/migrations/0026_contributor_is_curator_and_more.py b/osf/migrations/0026_add_is_institutional_request_is_curator.py similarity index 89% rename from osf/migrations/0026_contributor_is_curator_and_more.py rename to osf/migrations/0026_add_is_institutional_request_is_curator.py index 84dbbb32bf1..3c597ab68d7 100644 --- a/osf/migrations/0026_contributor_is_curator_and_more.py +++ b/osf/migrations/0026_add_is_institutional_request_is_curator.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('osf', '0025_contributor_is_curator_and_more'), + ('osf', 'osf/migrations/0025_institutional_request_access_enabled_and_more'), ] operations = [