# HG changeset patch # User nishanth # Date 1279313190 -19800 # Node ID b68ff7095ca5828542e9f2f624953c9294da890e # Parent f0bc4f5ee0ab84504b0abaff0d36501948872d46 added the registrantinfo creation part in register view diff -r f0bc4f5ee0ab -r b68ff7095ca5 sdi/views.py --- a/sdi/views.py Sat Jul 17 02:05:43 2010 +0530 +++ b/sdi/views.py Sat Jul 17 02:16:30 2010 +0530 @@ -17,7 +17,7 @@ if request.method == "POST": form = RegisterForm(request.POST) if form.is_valid(): - form.save() + user = form.save() data = form.cleaned_data first_name = data['first_name'] @@ -25,6 +25,13 @@ email = data['email'] send_reg_complete_mail(email, first_name, last_name) + user_info = RegistrantInfo() + user_info.registrant = user + user_info.status_of_attending_sagedays = "1" + user_info.status_of_attending_workshop = True if user.need_for_python_workshop else False + user_info.status_of_accomodation = "1" if user.acco_required else "0" + user_info.save() + return redirect("/sage_days/registration/complete") else: return render_to_response("register.html", {"form":form})