#NEWLINE# def delete_image_files( sender , instance , **kwargs ) : #NEWLINE# #INDENT# "\n        Deletes the original image, created thumbnails, and any entries\n        in sorl's key-value store.\n        " #NEWLINE# image_fields = ( models . ImageField , thumbnail . ImageField ) #NEWLINE# for field in instance . _meta . fields : #NEWLINE# #INDENT# if isinstance ( field , image_fields ) : #NEWLINE# #INDENT# fieldfile = getattr ( image_fields , field . name ) #NEWLINE# try : #NEWLINE# #INDENT# thumbnail . delete ( fieldfile ) #NEWLINE# #UNINDENT# except ThumbnailError : #NEWLINE# #INDENT# pass