Skip to main content

validate_image_file_extension

Validates that the provided file value has an extension matching the list of currently available image extensions.

def validate_image_file_extension(
value: File
) - > None

Validates that a file's extension matches one of the currently supported image formats allowed by the system.

Parameters

NameTypeDescription
valueFileThe uploaded file object or file path containing the extension to be validated against the allowed image extensions list.

Returns

TypeDescription
NoneReturns None if the validation passes; otherwise, raises a ValidationError if the file extension is not supported.