sdi/views.py
branchanoop
changeset 118 6c3602582f9f
parent 117 af9472ab8f3e
child 120 f9408ab30ace
equal deleted inserted replaced
117:af9472ab8f3e 118:6c3602582f9f
     5 
     5 
     6 from django.contrib.auth import authenticate, login, logout
     6 from django.contrib.auth import authenticate, login, logout
     7 
     7 
     8 from sage_days.sdi.models import Registrant
     8 from sage_days.sdi.models import Registrant
     9 from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm
     9 from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm
    10 from sage_days.sdi.events import send_reg_complete_mail, mail_invi
    10 from sage_days.sdi.events import send_reg_complete_mail, mail_invi, send_wsp_ptc_confirm
    11 from sage_days.settings import APACHE_URL_PREFIX as aup
    11 from sage_days.settings import APACHE_URL_PREFIX as aup
    12 
    12 
    13 def register(request):
    13 def register(request):
    14     """ The user register page.
    14     """ The user register page.
    15     """
    15     """
   141         selected_users = form.cleaned_data['selected_users']
   141         selected_users = form.cleaned_data['selected_users']
   142         for user in selected_users:
   142         for user in selected_users:
   143             user_info = user.registrantinfo_set.all()[0]
   143             user_info = user.registrantinfo_set.all()[0]
   144             user_info.status_of_attending_sagedays = "2"
   144             user_info.status_of_attending_sagedays = "2"
   145             user_info.save()
   145             user_info.save()
       
   146 
       
   147             send_wsp_ptc_confirm(user)
   146         
   148         
   147         return render_to_response("sent_sgd_confirm.html", {"selected_users":selected_users})
   149         return render_to_response("sent_sgd_confirm.html", {"selected_users":selected_users})
   148     else:
   150     else:
   149         return render_to_response("send_sgd_cnf.html", {"attending":attending_ppl, 
   151         return render_to_response("send_sgd_cnf.html", {"attending":attending_ppl, 
   150                                                 "not_confirmed":not_confirmed_ppl,
   152                                                 "not_confirmed":not_confirmed_ppl,