# HG changeset patch # User nishanth # Date 1271326876 -19800 # Node ID ff5f34e42aec0daffbef2a0705bf3d29d3128829 # Parent b66d405eb8c738eca63f89dc80dfe8d14c0b4293 registration for workshop is now integrated with man registartion. diff -r b66d405eb8c7 -r ff5f34e42aec reg/events.py --- a/reg/events.py Thu Apr 15 15:10:31 2010 +0530 +++ b/reg/events.py Thu Apr 15 15:51:16 2010 +0530 @@ -1,7 +1,7 @@ #!/usr/bin/python from django.contrib.auth.models import User - +from django.core.mail import send_mail from django.db import IntegrityError from workshop.reg.models import Profile, Event diff -r b66d405eb8c7 -r ff5f34e42aec reg/site/urls.py --- a/reg/site/urls.py Thu Apr 15 15:10:31 2010 +0530 +++ b/reg/site/urls.py Thu Apr 15 15:51:16 2010 +0530 @@ -6,7 +6,7 @@ (r'^$', reg_views.homepage), (r'^login/$', reg_views.user_login), (r'^logout/$', reg_views.user_logout), - (r'^register/(\w+)$', reg_views.user_register), + (r'^register/(\w*)$', reg_views.user_register), (r'^account_created/$', reg_views.account_created), (r'^resend_activation/$', reg_views.resend_activation), (r'^activate/(\w+)/$', reg_views.account_activate), diff -r b66d405eb8c7 -r ff5f34e42aec reg/views.py --- a/reg/views.py Thu Apr 15 15:10:31 2010 +0530 +++ b/reg/views.py Thu Apr 15 15:51:16 2010 +0530 @@ -69,8 +69,10 @@ except Event.DoesNotExist: raise Http404 - if not event.registration_is_open: - raise Http404 + if not event.registration_is_open: + raise Http404 + else: + event = None if request.method == "POST": form = reg_forms.RegisterForm(request.POST) @@ -87,16 +89,16 @@ ) reg_events.send_activation(new_user) - if event_key: + if event: event.attendees.add(new_user) event.save() return redirect('/reg/account_created') else: - return render_to_response('register.html', {'form':form}) + return render_to_response('register.html', {'form':form, 'event':event}) else: form = reg_forms.RegisterForm() - return render_to_response('register.html', {'form':form}) + return render_to_response('register.html', {'form':form, 'event':event}) def account_created(request): """ simply display a page. diff -r b66d405eb8c7 -r ff5f34e42aec templates/account_activated.html --- a/templates/account_activated.html Thu Apr 15 15:10:31 2010 +0530 +++ b/templates/account_activated.html Thu Apr 15 15:51:16 2010 +0530 @@ -1,4 +1,4 @@ {% extends "base.html" %} {% block content %} -Your account has been activated. +Your account has been activated and your registration has been confirmed. {% endblock %} diff -r b66d405eb8c7 -r ff5f34e42aec templates/account_created.html --- a/templates/account_created.html Thu Apr 15 15:10:31 2010 +0530 +++ b/templates/account_created.html Thu Apr 15 15:51:16 2010 +0530 @@ -1,5 +1,5 @@ {% extends "base.html" %} {% block content %} Account has been created and an activation email has been sent to your email address.
-click here to go to login page. +Please activate your account to confirm the registration. {% endblock %} diff -r b66d405eb8c7 -r ff5f34e42aec templates/register.html --- a/templates/register.html Thu Apr 15 15:10:31 2010 +0530 +++ b/templates/register.html Thu Apr 15 15:51:16 2010 +0530 @@ -1,5 +1,8 @@ {% extends "base.html" %} {% block content %} +{% if event %} + Register for workshop {{event.title}} to be conducted at {{event.venue}}
+{% endif %}
{{ form.as_p }} diff -r b66d405eb8c7 -r ff5f34e42aec templates/sent_activationkey.html --- a/templates/sent_activationkey.html Thu Apr 15 15:10:31 2010 +0530 +++ b/templates/sent_activationkey.html Thu Apr 15 15:51:16 2010 +0530 @@ -1,5 +1,4 @@ {% extends "base.html" %} {% block content %} Activation email has been sent to your email address.
-click here to go to home page. {% endblock %} diff -r b66d405eb8c7 -r ff5f34e42aec templates/view_event.html --- a/templates/view_event.html Thu Apr 15 15:10:31 2010 +0530 +++ b/templates/view_event.html Thu Apr 15 15:51:16 2010 +0530 @@ -17,7 +17,7 @@ Registration for this workshop is not open at this moment.
{% endif %} {% else %} - You must be a registered user to register for this workshop.
+ Register for this workshop.
{% endif %} {% if can_submit_feedback %}