Python django.core.validators.FileExtensionValidator() Examples

The following are 1 code examples of django.core.validators.FileExtensionValidator(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.core.validators , or try the search function .
Example #1
Source File: models.py    From dvhb-hybrid with MIT License 5 votes vote down vote up
def validate_image_and_svg_file_extension(value):
    allowed_extensions = get_available_image_extensions() + ["svg"]
    return FileExtensionValidator(allowed_extensions=allowed_extensions)(value)