Fixed #365: Actually clear profile images on check

This commit is contained in:
Andrew Godwin 2023-01-08 14:47:44 -07:00
parent fa003e2be6
commit 0cfd0813f2

View file

@ -94,6 +94,14 @@ class ProfilePage(FormView):
resize_image(image, size=(1500, 500)),
)
identity.metadata = form.cleaned_data.get("metadata")
# Clear images if specified
if "icon__clear" in self.request.POST:
identity.icon = None
if "image__clear" in self.request.POST:
identity.image = None
# Save and propagate
identity.save()
identity.transition_perform(IdentityStates.edited)