# HG changeset patch # User Madhusudan.C.S # Date 1279663120 -19800 # Node ID 70fcb57d8d151bb88aaa68e3d13eac741ea885fa # Parent 3a325a865252e2a4fe2c79a42bffb9281313fba3 Added event and registrants to Registration summary page. diff -r 3a325a865252 -r 70fcb57d8d15 project/scipycon/registration/views.py --- a/project/scipycon/registration/views.py Wed Jul 21 03:27:56 2010 +0530 +++ b/project/scipycon/registration/views.py Wed Jul 21 03:28:40 2010 +0530 @@ -30,10 +30,21 @@ """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 @@ 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 @@ # 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()