Forums

form.save() Does not Work. No errors in logs.

The code is supposed to update a user's profile image.
The "profile has been updated" success message is displayed, but the file name does not change in the Admin panel.
Thanks in advance.

if request.method == "POST":
    user = request.user
    form = UserUpdateForm(request.POST, request.FILES, instance=user)
    if form.is_valid():
        user_form = form.save()
        messages.success(request, f'{user_form.username}, Your profile has been updated!')
        return redirect("profile", user_form.username)

We could help with you with PythonAnyhwere, but for more general Django questions you need to ask on more general Django forums.