fixed 2 bugs
authorNishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 14:41:09 +0530
changeset 315 c63a9519dc37
parent 314 f920dd4599df
child 316 09178605d59e
fixed 2 bugs
pytask/profile/forms.py
pytask/profile/regbackend.py
--- a/pytask/profile/forms.py	Sat Jan 08 14:04:08 2011 +0530
+++ b/pytask/profile/forms.py	Sat Jan 08 14:41:09 2011 +0530
@@ -89,7 +89,7 @@
 
     class Meta:
         model = Profile
-        fields = ['full_name', 'aboutme', 'gender', 'dob', 'address', 'phonenum']
+        exclude = ['pynts', 'rights']
 
 class EditProfileForm(forms.ModelForm):
 
--- a/pytask/profile/regbackend.py	Sat Jan 08 14:04:08 2011 +0530
+++ b/pytask/profile/regbackend.py	Sat Jan 08 14:41:09 2011 +0530
@@ -1,14 +1,14 @@
 from pytask.profile.models import Profile
 from pytask.profile.forms import CreateProfileForm
+from pytask.utils import make_key
 
 from registration.signals import user_registered
 
 def user_created(sender, user, request, **kwargs):
 
-    data = request.POST
-    data.update({"user": user, "uniq_key": make_key(Profile)})
+    data = request.POST.copy()
+    data.update({"user": user.id, "uniq_key": make_key(Profile)})
     form = CreateProfileForm(data)
-    form.is_valid()
     form.save()
 
 user_registered.connect(user_created)