Skip to content

Commit

Permalink
[IAC][Group CR][ENG-6751] (#10923)
Browse files Browse the repository at this point in the history
## Purpose

Make some recommended changes from our CR group. Thanks to @felliott  and others for keen eyes.

## Changes

- Squash migrations
- fix typos
  • Loading branch information
Johnetordoff authored Jan 17, 2025
1 parent e5cc7fe commit d75b026
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 36 deletions.
6 changes: 3 additions & 3 deletions api/requests/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions api/users/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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',
Expand Down
28 changes: 0 additions & 28 deletions osf/migrations/0026_add_is_institutional_request_is_curator.py

This file was deleted.

0 comments on commit d75b026

Please sign in to comment.