class UserRegisterPostSchema(BaseSchema): username = fields.String(validate=validate.Length(min=1, max=256)) password = fields.String(validate=validate.Length(min=1), required=True) firstname = fields.String(missing=None) lastname = fields.String(missing=None) email_address = fields.Email(required=True) purpose = fields.Constant('user')
class PasswordResetQueryParameters(BaseSchema): username = fields.String(validate=validate.Length(min=1, max=256), missing=None) email_address = fields.Email(data_key='email', missing=None) @validates_schema def validate_mutually_exclusive_fields(self, data, **kwargs): username = data.get('username') email = data.get('email_address') if (username, email).count(None) != 1: msg = '"username" or "email" should be used' raise ValidationError(msg)
class _AdminEmailSchema(BaseSchema): address = fields.Email(required=True) confirmed = fields.Boolean(missing=None, allow_none=True) main = fields.Boolean(missing=False)
class _UserEmailSchema(BaseSchema): address = fields.Email(required=True) main = fields.Boolean(missing=False)
class UserPostSchema(_BaseUserSchema): uuid = fields.UUID() password = fields.String(validate=validate.Length(min=1), allow_none=True) email_address = fields.Email(allow_none=True)
class RecordingMediaExportRequestSchema(CDRListingBase): email = fields.Email(missing=None)