Skip to content

Commit

Permalink
fix migrations and admin institutional permissions problems
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Jan 13, 2025
1 parent 78597c8 commit 1fbb50d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion admin/institutions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 1fbb50d

Please sign in to comment.