# HG changeset patch # User Madhusudan.C.S # Date 1279663161 -19800 # Node ID ea9477690acd58dbad6d20537c5af4451631d025 # Parent 70fcb57d8d151bb88aaa68e3d13eac741ea885fa Added creation of profile to user creation since signals were removed. diff -r 70fcb57d8d15 -r ea9477690acd project/scipycon/user/utils.py --- a/project/scipycon/user/utils.py Wed Jul 21 03:28:40 2010 +0530 +++ b/project/scipycon/user/utils.py Wed Jul 21 03:29:21 2010 +0530 @@ -6,10 +6,11 @@ from PIL import Image +from project.scipycon.base.models import Event from project.scipycon.user.models import UserProfile -def scipycon_createregistrant(request, data): +def scipycon_createregistrant(request, data, scope): """Create user """ @@ -32,6 +33,14 @@ user.last_name = last_name user.save() + scope_entity = Event.objects.get(scope=scope) + try: + profile = user.get_profile() + except: + profile, new = UserProfile.objects.get_or_create( + user=user, scope=scope_entity) + profile.save() + return user def scipycon_createuser(request, data, scope): @@ -41,8 +50,6 @@ from django.contrib.auth import authenticate from django.contrib.auth import login - from project.scipycon.base.models import Event - email = data.get('email') username = data.get('username') password = data.get('password_1')