Module licenseware.common.validators.validate_icon
Expand source code
from marshmallow import ValidationError
def validate_icon(value):
accepted_icon_types = ('.png', '.svg', '.jpg', '.jpeg', '.webp')
if not value.endswith(accepted_icon_types):
raise ValidationError(f"Icons must be of type {accepted_icon_types}")
Functions
def validate_icon(value)
-
Expand source code
def validate_icon(value): accepted_icon_types = ('.png', '.svg', '.jpg', '.jpeg', '.webp') if not value.endswith(accepted_icon_types): raise ValidationError(f"Icons must be of type {accepted_icon_types}")