204 }) |
204 }) |
205 |
205 |
206 def confirm_wsp_participation(request, uid): |
206 def confirm_wsp_participation(request, uid): |
207 """ match id versus email and take lappy details. |
207 """ match id versus email and take lappy details. |
208 """ |
208 """ |
209 |
209 return render_to_response("workshop_info.html") |
210 try: |
|
211 email = request.GET['email'] |
|
212 except MultiValueDictKeyError: |
|
213 raise Http404 |
|
214 |
|
215 try: |
|
216 user = Registrant.objects.get(id=uid, email=email) |
|
217 except Registrant.DoesNotExist: |
|
218 raise Http404 |
|
219 |
|
220 user_info = user.registrantinfo_set.all()[0] |
|
221 status = user_info.status_of_attending_workshop |
|
222 if status == "3": |
|
223 return render_to_response("attending_wsp.html") |
|
224 elif status != "2": |
|
225 raise Http404 |
|
226 |
|
227 if request.method == "POST": |
|
228 try: |
|
229 has_laptop = request.POST['lap_status'] |
|
230 except MultiValueDictKeyError: |
|
231 return render_to_response("cnf_wsp_ptc.html", {"user":user}) |
|
232 |
|
233 user_info.status_of_attending_workshop = "3" |
|
234 user_info.has_laptop_for_workshop = True if has_laptop == "True" else False |
|
235 user_info.save() |
|
236 |
|
237 return render_to_response("attending_wsp.html") |
|
238 else: |
|
239 return render_to_response("cnf_wsp_ptc.html", {"user":user}) |
|
240 |
210 |
241 def confirm_sgd_participation(request, uid): |
211 def confirm_sgd_participation(request, uid): |
242 """ match id versus email and take lappy details. |
212 """ match id versus email and take lappy details. |
243 """ |
213 """ |
244 |
214 |