# HG changeset patch # User nishanth # Date 1279308775 -19800 # Node ID 269ce2dfd428d34cecd724186b27735b10ef4b66 # Parent f9408ab30ace2fe68d04678499422c8a2761287e# Parent eecbb1e59a3af71ac66f3f461eed44fe8ee54d47 merged diff -r eecbb1e59a3a -r 269ce2dfd428 sdi/site/urls.py --- a/sdi/site/urls.py Sat Jul 17 00:27:48 2010 +0530 +++ b/sdi/site/urls.py Sat Jul 17 01:02:55 2010 +0530 @@ -1,7 +1,7 @@ from django.conf.urls.defaults import * from sage_days.sdi.views import register, reg_complete, list_stats, homepage, send_invi, admin_login, admin_logout -from sage_days.sdi.views import send_workshop_confirm, confirm_wsp_participation, send_sagedays_confirm +from sage_days.sdi.views import send_workshop_confirm, confirm_wsp_participation, send_sagedays_confirm, confirm_sgd_participation urlpatterns = patterns('', (r'^register/$', register), @@ -13,5 +13,6 @@ (r'^send_wsp_cnf/$', send_workshop_confirm), (r'^cnf_wsp_ptc/(\w+)/$', confirm_wsp_participation), (r'^send_sgd_cnf/$', send_sagedays_confirm), + (r'^cnf_sgd_ptc/(\w+)/$', confirm_sgd_participation), ) diff -r eecbb1e59a3a -r 269ce2dfd428 sdi/views.py --- a/sdi/views.py Sat Jul 17 00:27:48 2010 +0530 +++ b/sdi/views.py Sat Jul 17 01:02:55 2010 +0530 @@ -5,7 +5,7 @@ from django.contrib.auth import authenticate, login, logout -from sage_days.sdi.models import Registrant +from sage_days.sdi.models import Registrant, RegistrantInfo, ParticipantInfo from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm from sage_days.sdi.events import send_reg_complete_mail, mail_invi, send_wsp_ptc_confirm from sage_days.settings import APACHE_URL_PREFIX as aup @@ -188,6 +188,35 @@ else: return render_to_response("cnf_wsp_ptc.html", {"user":user}) +def confirm_sgd_participation(request, uid): + """ match id versus email and take lappy details. + """ + + try: + email = request.GET['email'] + except MultiValueDictKeyError: + raise Http404 + + try: + user = Registrant.objects.get(id=uid, email=email) + except Registrant.DoesNotExist: + raise Http404 + + user_info = user.registrantinfo_set.all()[0] + status = user_info.status_of_attending_sagedays + if status == "3": + return render_to_response("attending_sgd.html") + elif status != 2: + raise Http404 + + if request.method == "POST": + participant_info = ParticipantInfo() + participant_info.participant = user + participant_info.save() + else: + return render_to_response("cnf_sgd_ptc.html", {"user":user}) + + def admin_login(request): """ basic login. """ diff -r eecbb1e59a3a -r 269ce2dfd428 templates/cnf_sgd_ptc.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/cnf_sgd_ptc.html Sat Jul 17 01:02:55 2010 +0530 @@ -0,0 +1,17 @@ +{% extends 'base.html' %} +{% block title %} +Confirm Participation in Sage Days +{% endblock %} +{% block content %} +Dear {{user}},

+Thank you for your interest in attending Sage Days. +

+There are just a few more details we would like to know.
+Please fill the following details and confirm your participation.
+
+
+ {{form.as_p}} + +
+{% endblock %} +