django_ocr_server/models.py
def is_valid_file_type(file_type, raise_exception=False):
        """
        This functions checks that file_type contains a correct value. 2019-03-20
        :param file_type:
        :param raise_exception:
        :return: boolean. True if file_type contains a correct value
        """
        if not file_type:
            if raise_exception:
                raise FileTypeError(_('The content type of the file is null'))
            else:
                return False
        if file_type not in getattr(settings, 'OCR_ALLOWED_FILE_TYPES', ocr_default_settings.ALLOWED_FILE_TYPES):
            if raise_exception:
                raise FileTypeError(file_type)
            else:
                return False
        return True

        This functions checks that file_type contains a correct value. 2019-03-20
        :param file_type:
        :param raise_exception:
        :return: boolean. True if file_type contains a correct value
        
This functions checks that file_type contains a correct value.
This functions checks that file_type contains a correct value .
def is_valid_file_type(file_type, raise_exception=False):
        if not file_type:
            if raise_exception:
                raise FileTypeError(_('The content type of the file is null'))
            else:
                return False
        if file_type not in getattr(settings, 'OCR_ALLOWED_FILE_TYPES', ocr_default_settings.ALLOWED_FILE_TYPES):
            if raise_exception:
                raise FileTypeError(file_type)
            else:
                return False
        return True
def is_valid_file_type ( file_type , raise_exception = False ) : if not file_type : if raise_exception : raise FileTypeError ( _ ( 'The content type of the file is null' ) ) else : return False if file_type not in getattr ( settings , 'OCR_ALLOWED_FILE_TYPES' , ocr_default_settings . ALLOWED_FILE_TYPES ) : if raise_exception : raise FileTypeError ( file_type ) else : return False return True
This functions checks that file_type contains a correct value.
This functions checks that file_type contains a correct value .
"""
        This functions checks that file_type contains a correct value. 2019-03-20
        :param file_type:
        :param raise_exception:
        :return: boolean. True if file_type contains a correct value
        """
boolean. True if file_type contains a correct value
boolean . True if file_type contains a correct value
file_type
None
raise_exception
None