Exemplo n.º 1
0
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')
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
class _AdminEmailSchema(BaseSchema):

    address = fields.Email(required=True)
    confirmed = fields.Boolean(missing=None, allow_none=True)
    main = fields.Boolean(missing=False)
Exemplo n.º 4
0
class _UserEmailSchema(BaseSchema):

    address = fields.Email(required=True)
    main = fields.Boolean(missing=False)
Exemplo n.º 5
0
class UserPostSchema(_BaseUserSchema):

    uuid = fields.UUID()
    password = fields.String(validate=validate.Length(min=1), allow_none=True)
    email_address = fields.Email(allow_none=True)
Exemplo n.º 6
0
class RecordingMediaExportRequestSchema(CDRListingBase):
    email = fields.Email(missing=None)