summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorMadhusudan.C.S2010-07-21 03:28:40 +0530
committerMadhusudan.C.S2010-07-21 03:28:40 +0530
commite99f3591129b3df1a7cd737938a8d64151a36341 (patch)
tree26cef2615ff00e1b571fb2d053a8d51ad25cb623 /project
parent4feb5de93af042a3a7e746e4b9edca78b199b775 (diff)
downloadscipycon-e99f3591129b3df1a7cd737938a8d64151a36341.tar.gz
scipycon-e99f3591129b3df1a7cd737938a8d64151a36341.tar.bz2
scipycon-e99f3591129b3df1a7cd737938a8d64151a36341.zip
Added event and registrants to Registration summary page.
Diffstat (limited to 'project')
-rw-r--r--project/scipycon/registration/views.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/project/scipycon/registration/views.py b/project/scipycon/registration/views.py
index b9d6419..c7d889f 100644
--- a/project/scipycon/registration/views.py
+++ b/project/scipycon/registration/views.py
@@ -30,10 +30,21 @@ def registrations(request, scope,
"""Simple page to count registrations"""
registrations = Registration.objects.all().count()
+
+ user = request.user
+ if user.is_authenticated():
+ registration = Registration.objects.get(registrant=user)
+ else:
+ registration = None
+
+ event = Event.objects.get(scope=scope)
+
return render_to_response(template_name, RequestContext(request, {
'params': {'scope': scope},
'over_reg' : registrations >= REG_TOTAL and True or False,
- 'registrations' : registrations}))
+ 'registrations' : registrations,
+ 'registration': registration,
+ 'event': event}))
@login_required
def edit_registration(request, scope, id,
@@ -164,7 +175,7 @@ def submit_registration(request, scope,
if not user.is_authenticated():
if registrant_form.is_valid():
newuser = scipycon_createregistrant(
- request, registrant_form.data)
+ request, registrant_form.data, scope)
# Log in user
passwd = User.objects.make_random_password()
@@ -210,7 +221,7 @@ def submit_registration(request, scope,
# get id and use as slug and invoice number
id = reg.id
- slug = 'SPYIN10%05d' % id
+ slug = 'SCIPYIN2010%04d' % id
reg.slug = slug
reg.save()