From 9e7e1a5ea6e802e49d12c72ca7dcd89807ec16c7 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Oct 2010 01:05:29 -0500 Subject: Make it actually possible to upload a new dev image We need to both submit the form with the correct encoding and then bind the form itself to request.FILES and not just request.POST. Signed-off-by: Dan McGee --- devel/views.py | 2 +- templates/devel/profile.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/devel/views.py b/devel/views.py index 381b4a4..e999b7f 100644 --- a/devel/views.py +++ b/devel/views.py @@ -74,7 +74,7 @@ class UserProfileForm(forms.ModelForm): def change_profile(request): if request.POST: form = ProfileForm(request.POST) - profile_form = UserProfileForm(data=request.POST, instance=request.user.get_profile()) + profile_form = UserProfileForm(request.POST, request.FILES, instance=request.user.get_profile()) if form.is_valid() and profile_form.is_valid(): request.user.email = form.cleaned_data['email'] if form.cleaned_data['passwd1']: diff --git a/templates/devel/profile.html b/templates/devel/profile.html index 4da6dad..2f16801 100644 --- a/templates/devel/profile.html +++ b/templates/devel/profile.html @@ -6,7 +6,7 @@

Developer Profile

-
{% csrf_token %} + {% csrf_token %}

Note: This is the public information shown on the developer and/or TU profiles page, so please be appropriate with the information you provide here.

-- cgit v1.2.3-24-g4f1b