sdi/views.py
branchanoop
changeset 182 27e0bc9425a2
parent 179 ac558619d49d
child 183 3603ee3de179
equal deleted inserted replaced
181:885ee4edbf7d 182:27e0bc9425a2
   150     attending_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3")
   150     attending_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3")
   151     not_confirmed_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="2")
   151     not_confirmed_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="2")
   152     not_selected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="1")
   152     not_selected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="1")
   153 
   153 
   154     user_choices = list(not_selected_ppl) + list(not_confirmed_ppl)
   154     user_choices = list(not_selected_ppl) + list(not_confirmed_ppl)
   155     form = SendAccoForm(user_choices, request.POST)
   155     form = UserSelectForm(user_choices, request.POST)
   156 
   156 
   157     if request.method == "POST" and form.is_valid():
   157     if request.method == "POST" and form.is_valid():
   158         selected_users = form.cleaned_data['selected_users']
   158         selected_users = form.cleaned_data['selected_users']
   159         for user in selected_users:
   159         for user in selected_users:
   160             user_info = user.registrantinfo_set.all()[0]
   160             user_info = user.registrantinfo_set.all()[0]
   182                                                        registrantinfo__status_of_accomodation="3")
   182                                                        registrantinfo__status_of_accomodation="3")
   183     not_selected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3", 
   183     not_selected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3", 
   184                                                  registrantinfo__status_of_accomodation="1")
   184                                                  registrantinfo__status_of_accomodation="1")
   185 
   185 
   186     user_choices = list(rejected_ppl) + list(not_selected_ppl)
   186     user_choices = list(rejected_ppl) + list(not_selected_ppl)
   187     form = UserSelectForm(user_choices, request.POST)
   187     form = SendAccoForm(user_choices, request.POST)
   188 
   188 
   189     if request.method == "POST" and form.is_valid():
   189     if request.method == "POST" and form.is_valid():
   190         selected_users = form.cleaned_data['selected_users']
   190         selected_users = form.cleaned_data['selected_users']
   191         for user in selected_users:
   191         for user in selected_users:
   192             user_info = user.registrantinfo_set.all()[0]
   192             user_info = user.registrantinfo_set.all()[0]