(image_file)
return image_file
Handle uploaded file.

    :param django.core.files.uploadedfile.InMemoryUploadedFile image_file:
    :return string: Path to the image (relative).
Handle uploaded file.
Handle uploaded file .
def handle_uploaded_file(image_file):
    """Handle uploaded file.

    :param django.core.files.uploadedfile.InMemoryUploadedFile image_file:
    :return string: Path to the image (relative).
    """
    if isinstance(image_file, File):
        destination_path = ensure_unique_filename(
            os.path.join(IMAGES_UPLOAD_DIR_ABSOLUTE_PATH, image_file.name)
        )
        image_filename = image_file.name
        with open(destination_path, 'wb+') as destination:
            image_filename = os.path.basename(destination.name)
            for chunk in image_file.chunks():
                destination.write(chunk)
        return os.path.join(IMAGES_UPLOAD_DIR, image_filename)
    return image_file
def handle_uploaded_file ( image_file ) : if isinstance ( image_file , File ) : destination_path = ensure_unique_filename ( os . path . join ( IMAGES_UPLOAD_DIR_ABSOLUTE_PATH , image_file . name ) ) image_filename = image_file . name with open ( destination_path , 'wb+' ) as destination : image_filename = os . path . basename ( destination . name ) for chunk in image_file . chunks ( ) : destination . write ( chunk ) return os . path . join ( IMAGES_UPLOAD_DIR , image_filename ) return image_file