-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schemas: move user notifications schemas from config to own file
- Loading branch information
Showing
2 changed files
with
33 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2023 Graz University of Technology. | ||
# | ||
# Invenio App RDM is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""RDM User Schemas.""" | ||
|
||
|
||
from invenio_users_resources.services.schemas import ( | ||
NotificationPreferences, | ||
UserPreferencesSchema, | ||
UserSchema, | ||
) | ||
from marshmallow import fields | ||
|
||
|
||
class UserPreferencesNotificationsSchema(UserPreferencesSchema): | ||
"""Schema extending preferences with notification preferences for model validation.""" | ||
|
||
notifications = fields.Nested(NotificationPreferences) | ||
|
||
|
||
class NotificationsUserSchema(UserSchema): | ||
"""Schema extending preferences with notification preferences for user service.""" | ||
|
||
preferences = fields.Nested(UserPreferencesNotificationsSchema) |