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 <dan@archlinux.org>
This commit is contained in:
Dan McGee 2010-10-06 01:05:29 -05:00
parent d6d9a08e63
commit 9e7e1a5ea6
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ class Meta:
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']:

View File

@ -6,7 +6,7 @@
<h2>Developer Profile</h2>
<form id="edit-profile-form" method="post">{% csrf_token %}
<form id="edit-profile-form" enctype="multipart/form-data" method="post">{% csrf_token %}
<p><em>Note:</em> This is the public information shown on the developer
and/or TU profiles page, so please be appropriate with the information
you provide here.</p>