mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 07:46:06 -04:00
Update add_user_to_service endoint to only handle new data format
Updated the add_user_to_service endpoint to only handle data in the
'new' format (`{"permissions": [...]}` instead of `[permission_1, permission_2]`)
since Admin has been updated to send data the new way.
This change means that we no longer need the Marshmallow Permission
schema, so it can be deleted.
This commit is contained in:
@@ -539,24 +539,6 @@ class InvitedUserSchema(BaseSchema):
|
||||
raise ValidationError(str(e))
|
||||
|
||||
|
||||
class PermissionSchema(BaseSchema):
|
||||
|
||||
# Override generated fields
|
||||
user = field_for(models.Permission, 'user', dump_only=True)
|
||||
service = field_for(models.Permission, 'service', dump_only=True)
|
||||
permission = field_for(models.Permission, 'permission')
|
||||
|
||||
__envelope__ = {
|
||||
'single': 'permission',
|
||||
'many': 'permissions',
|
||||
}
|
||||
|
||||
class Meta:
|
||||
model = models.Permission
|
||||
exclude = ("created_at",)
|
||||
strict = True
|
||||
|
||||
|
||||
class EmailDataSchema(ma.Schema):
|
||||
|
||||
class Meta:
|
||||
@@ -692,7 +674,6 @@ notification_schema = NotificationModelSchema()
|
||||
notification_with_template_schema = NotificationWithTemplateSchema()
|
||||
notification_with_personalisation_schema = NotificationWithPersonalisationSchema()
|
||||
invited_user_schema = InvitedUserSchema()
|
||||
permission_schema = PermissionSchema()
|
||||
email_data_request_schema = EmailDataSchema()
|
||||
partial_email_data_request_schema = EmailDataSchema(partial_email=True)
|
||||
notifications_filter_schema = NotificationsFilterSchema()
|
||||
|
||||
Reference in New Issue
Block a user