72
I have model UserProfile with field avatar = models.ImageField(upload_to=upload_avatar)
upload_avatar function names image file according user.id (12.png for example).
But when user updates the avatar, new avatar name coincide with old avatar name and Django adds suffix to file name (12-1.png for example).
There are way to overwrite file instead of create new file?