Created a custom backend
authorNishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 14:00:14 +0530
changeset 313 d64b83bdf5a8
parent 312 a8fbe291385c
child 314 f920dd4599df
Created a custom backend
pytask/profile/regbackend.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pytask/profile/regbackend.py	Sat Jan 08 14:00:14 2011 +0530
@@ -0,0 +1,15 @@
+from pytask.profile.models import Profile
+from pytask.profile.forms import CreateProfileForm
+
+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)})
+    form = CreateProfileForm(data)
+    form.is_valid()
+    form.save()
+
+user_registered.connect(user_created)
+