mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-17 18:52:30 -05:00
Ensure UserUpdatePasswordSchema only loads _password
We had the `only` defined in the Meta class, and this wasn't working - any extra fields were also being loaded. This moves it to the point where the class is instantiated, which now works.
This commit is contained in:
@@ -180,7 +180,6 @@ class UserUpdatePasswordSchema(BaseSchema):
|
||||
|
||||
class Meta(BaseSchema.Meta):
|
||||
model = models.User
|
||||
only = ('password')
|
||||
strict = True
|
||||
|
||||
@validates_schema(pass_original=True)
|
||||
@@ -716,7 +715,7 @@ class UnarchivedTemplateSchema(BaseSchema):
|
||||
# should not be used on its own for dumping - only for loading
|
||||
create_user_schema = UserSchema()
|
||||
user_update_schema_load_json = UserUpdateAttributeSchema(load_json=True, partial=True)
|
||||
user_update_password_schema_load_json = UserUpdatePasswordSchema(load_json=True, partial=True)
|
||||
user_update_password_schema_load_json = UserUpdatePasswordSchema(only=('_password',), load_json=True, partial=True)
|
||||
service_schema = ServiceSchema()
|
||||
detailed_service_schema = DetailedServiceSchema()
|
||||
template_schema = TemplateSchema()
|
||||
|
||||
Reference in New Issue
Block a user