-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for "can_request_access" feature #10877
base: feature/institutional_access
Are you sure you want to change the base?
Changes from 1 commit
c3237e5
0e9ea90
b99f3d5
cdf4063
d1ee55f
45acf8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.15 on 2024-12-27 14:08 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bunch this in with the other migrations on this branch, just to be tidy. Delete both this and 0025 and re-run |
||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('osf', '0025_noderequest_requested_permissions_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='institution', | ||
name='can_request_access', | ||
field=models.BooleanField(db_index=True, default=False), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -646,7 +646,7 @@ def osf_groups(self): | |
|
||
def is_institutional_admin(self, institution): | ||
group_name = institution.format_group('institutional_admins') | ||
return self.groups.filter(name=group_name).exists() | ||
return self.groups.filter(name=group_name).exists() and institution.can_request_access | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's difficult question where this AND check should be in the codebase. The |
||
|
||
def group_role(self, group): | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it clear this refers to a specific feature. Refactor to something like
institutional_request_access_enabled