diff --git a/api/requests/serializers.py b/api/requests/serializers.py index 8ad450936c0..3723d8984e8 100644 --- a/api/requests/serializers.py +++ b/api/requests/serializers.py @@ -135,12 +135,12 @@ def to_internal_value(self, data): """ Retrieves the id value from `RelationshipField` fields """ - instituion_id = data.pop('institution', None) + institution_id = data.pop('institution', None) message_recipient_id = data.pop('message_recipient', None) data = super().to_internal_value(data) - if instituion_id: - data['institution'] = instituion_id + if institution_id: + data['institution'] = institution_id if message_recipient_id: data['message_recipient'] = message_recipient_id diff --git a/api/users/serializers.py b/api/users/serializers.py index a3bd4d1cdb4..2707a4141c0 100644 --- a/api/users/serializers.py +++ b/api/users/serializers.py @@ -716,10 +716,10 @@ def get_absolute_url(self, obj: UserMessage) -> str: ) def to_internal_value(self, data): - instituion_id = data.pop('institution', None) + institution_id = data.pop('institution', None) data = super().to_internal_value(data) - if instituion_id: - data['institution'] = instituion_id + if institution_id: + data['institution'] = institution_id return data class Meta: diff --git a/api/users/views.py b/api/users/views.py index c9063b1235e..314969d0c4c 100644 --- a/api/users/views.py +++ b/api/users/views.py @@ -971,7 +971,7 @@ class UserMessageView(JSONAPIBaseView, generics.CreateAPIView): UserMessagePermissions, ) - required_read_scopes = [CoreScopes.USERS_MESSAGE_READ_EMAIL] + required_read_scopes = [CoreScopes.NULL] required_write_scopes = [CoreScopes.USERS_MESSAGE_WRITE_EMAIL] parser_classes = (JSONAPIMultipleRelationshipsParser, JSONAPIMultipleRelationshipsParserForRegularJSON) throttle_classes = [BurstRateThrottle, SendEmailThrottle] diff --git a/osf/migrations/0025_institutional_request_access_enabled_and_more.py b/osf/migrations/0025_contributor_is_curator_and_more.py similarity index 84% rename from osf/migrations/0025_institutional_request_access_enabled_and_more.py rename to osf/migrations/0025_contributor_is_curator_and_more.py index 0d72e062b99..d1ce4bd6432 100644 --- a/osf/migrations/0025_institutional_request_access_enabled_and_more.py +++ b/osf/migrations/0025_contributor_is_curator_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.13 on 2025-01-09 19:19 +# Generated by Django 4.2.13 on 2025-01-16 20:36 from django.conf import settings from django.db import migrations, models @@ -14,16 +14,31 @@ class Migration(migrations.Migration): ] operations = [ + migrations.AddField( + model_name='contributor', + name='is_curator', + field=models.BooleanField(default=False), + ), migrations.AddField( model_name='institution', name='institutional_request_access_enabled', field=models.BooleanField(default=False), ), + migrations.AddField( + model_name='noderequest', + name='is_institutional_request', + field=models.BooleanField(default=False), + ), migrations.AddField( model_name='noderequest', name='requested_permissions', field=models.CharField(blank=True, choices=[('read', 'read'), ('write', 'write'), ('admin', 'admin')], help_text='The permissions being requested for the node (e.g., read, write, admin).', max_length=31, null=True), ), + migrations.AddField( + model_name='preprintrequest', + name='is_institutional_request', + field=models.BooleanField(default=False), + ), migrations.AlterField( model_name='noderequest', name='request_type', diff --git a/osf/migrations/0026_add_is_institutional_request_is_curator.py b/osf/migrations/0026_add_is_institutional_request_is_curator.py deleted file mode 100644 index 51da69ada2c..00000000000 --- a/osf/migrations/0026_add_is_institutional_request_is_curator.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 4.2.13 on 2025-01-10 19:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('osf', '0025_institutional_request_access_enabled_and_more'), - ] - - operations = [ - migrations.AddField( - model_name='contributor', - name='is_curator', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='noderequest', - name='is_institutional_request', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='preprintrequest', - name='is_institutional_request', - field=models.BooleanField(default=False), - ), - ]