diff options
author | anoop | 2010-02-23 19:42:12 +0530 |
---|---|---|
committer | anoop | 2010-02-23 19:42:12 +0530 |
commit | ddc16cd915c9314b7adf46fca8ea670718ffb867 (patch) | |
tree | 5b8f7b02309afe71b33135ead65ce03ec2557efb | |
parent | af3c449e3bc4e32fe516a2eae6831570856495b1 (diff) | |
download | pytask-ddc16cd915c9314b7adf46fca8ea670718ffb867.tar.gz pytask-ddc16cd915c9314b7adf46fca8ea670718ffb867.tar.bz2 pytask-ddc16cd915c9314b7adf46fca8ea670718ffb867.zip |
enabled photo uploading for user profile.
-rw-r--r-- | taskapp/views/user.py | 2 | ||||
-rw-r--r-- | templates/user/edit_profile.html | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/taskapp/views/user.py b/taskapp/views/user.py index a3af9ff..7581f35 100644 --- a/taskapp/views/user.py +++ b/taskapp/views/user.py @@ -74,7 +74,7 @@ def edit_my_profile(request): if request.user.is_authenticated() == True: profile = Profile.objects.get(user = request.user) data = request.POST#form.cleaned_data - properties = {'aboutme':data['aboutme'], 'foss_comm':data['foss_comm'], 'phonenum':data['phonenum'], 'homepage':data['homepage'], 'street':data['street'], 'city':data['city'], 'country':data['country'], 'nick':data['nick']} + properties = {'aboutme':data['aboutme'], 'foss_comm':data['foss_comm'], 'phonenum':data['phonenum'], 'homepage':data['homepage'], 'street':data['street'], 'city':data['city'], 'country':data['country'], 'nick':data['nick'],'photo':request.FILES['photo']} #fields = ['dob','gender','credits','aboutme','foss_comm','phonenum','homepage','street','city','country','nick'] updateProfile(profile,properties) return redirect('/user/view/uid='+str(profile.user_id)) diff --git a/templates/user/edit_profile.html b/templates/user/edit_profile.html index c7f5aff..43501ac 100644 --- a/templates/user/edit_profile.html +++ b/templates/user/edit_profile.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% block content %} - <form action="/user/edit/" method="post"> + <form action="/user/edit/" enctype = "multipart/form-data" method="post"> {{ edit_profile_form.as_p }} <input type="submit" value="Apply Changes" /> </form> |