backend/users/signals.py
def delete_avatar(sender, instance, **kwargs):
    """
    Deletes file from filesystem
    when corresponding User object will be deleted.
    """
    if instance.avatar:
        if os.path.isfile(instance.avatar.path):
            os.remove(instance.avatar.path)

    Deletes file from filesystem
    when corresponding User object will be deleted.
    
Deletes file from filesystem
when corresponding User object will be deleted.
Deletes file from filesystem when corresponding User object will be deleted .
def delete_avatar(sender, instance, **kwargs):
    if instance.avatar:
        if os.path.isfile(instance.avatar.path):
            os.remove(instance.avatar.path)
def delete_avatar ( sender , instance , ** kwargs ) : if instance . avatar : if os . path . isfile ( instance . avatar . path ) : os . remove ( instance . avatar . path )
Deletes file from filesystem
when corresponding User object will be deleted.
Deletes file from filesystem when corresponding User object will be deleted .
"""
    Deletes file from filesystem
    when corresponding User object will be deleted.
    """
sender
instance