186 user_choices = list(rejected_ppl) + list(not_selected_ppl) |
186 user_choices = list(rejected_ppl) + list(not_selected_ppl) |
187 form = SendAccoForm(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 message = form.cleaned_data['message'] |
191 for user in selected_users: |
192 for user in selected_users: |
192 user_info = user.registrantinfo_set.all()[0] |
193 user_info = user.registrantinfo_set.all()[0] |
193 user_info.status_of_accomodation = "3" |
194 user_info.status_of_accomodation = "3" |
194 user_info.save() |
195 user_info.save() |
195 |
196 |
196 message = form.cleaned_data['message'] |
|
197 send_acco_confirm(user, message) |
197 send_acco_confirm(user, message) |
198 |
198 |
199 return render_to_response("sent_acco_confirm.html", {"selected_users":selected_users}) |
199 return render_to_response("sent_acco_confirm.html", {"selected_users":selected_users}) |
200 else: |
200 else: |
201 return render_to_response("send_acco_cnf.html", {"rejected": rejected_ppl, |
201 return render_to_response("send_acco_cnf.html", {"rejected": rejected_ppl, |