Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar is not deleted #160

Open
DylannCordel opened this issue Feb 19, 2015 · 2 comments
Open

Avatar is not deleted #160

DylannCordel opened this issue Feb 19, 2015 · 2 comments

Comments

@DylannCordel
Copy link
Contributor

When a user upload an avatar, then check "delete" to delete it, avatar is only "unlinked" to this profile : not deleted from the server.

Ex : http://static.pybbm.org/media/pybb/avatar/cc46c3ed-41dd-429a-aee2-4c44cb6a5c28.png is still there but has been "deleted" from the demo's avatar.

Same behaviour when we "replace" the avatar. Ex : http://static.pybbm.org/media/pybb/avatar/f46e9eb3-39bf-4775-a243-9bcbd383fdfe.png is still there even after I replace demo's avatar with a magic pony image. (ok, this is a tux zombie, it's normal that a zombie remains even after we kill it. Maybe this is not a good exemple :-p)

Cause is : the default profile form does not manage avatar replacement / deletion.
When the widget return "False", it's because we want to delete the image. Form should delete the old image and then replace avatar's value from "False" to "None" (this will avoid an Exception incompatibility with easy_thumbnail : 'bool' object has no attribute '_committed' raised here (with a None value, this code is not executed).

Are you agree with this reasoning or am I misunderstanding something ?

@GeyseR
Copy link
Contributor

GeyseR commented Mar 25, 2015

Hi @DylannCordel!
This behaviour is default for any FileField in django since 1.3 version.
Look at release notes
So I think this should be handled via signals in project, not in app...

@DylannCordel
Copy link
Contributor Author

Hi @GeyseR

I disagree : avatar management is pybb's problem because it is its own field.
I think an "out of the box" app must works without having to add extra code to manage default behaviour. As default behaviour of Pybb is to allow to upload a new file to use it as avatar, default behaviour should also include this avatar deletion when an user wants to delete or update it.

We could add a setting to auto delete or not the avatar if you think this is needed, but I think pybb must manage the avatar deletion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants