equal
deleted
inserted
replaced
27 from project.scipycon.user.forms import UsernameForm |
27 from project.scipycon.user.forms import UsernameForm |
28 from project.scipycon.user.utils import handle_uploaded_photo |
28 from project.scipycon.user.utils import handle_uploaded_photo |
29 from project.scipycon.user.utils import scipycon_createuser |
29 from project.scipycon.user.utils import scipycon_createuser |
30 from project.scipycon.utils import set_message_cookie |
30 from project.scipycon.utils import set_message_cookie |
31 |
31 |
|
32 #User_dump Http404 Error |
|
33 from django.http import Http404 |
32 |
34 |
33 @login_required |
35 @login_required |
34 def account(request, scope, template_name="user/account.html"): |
36 def account(request, scope, template_name="user/account.html"): |
35 """Displays the main screen of the current user's account. |
37 """Displays the main screen of the current user's account. |
36 """ |
38 """ |
275 }) |
277 }) |
276 |
278 |
277 json_response = {'results': results} |
279 json_response = {'results': results} |
278 |
280 |
279 return HttpResponse(json.dumps(json_response)) |
281 return HttpResponse(json.dumps(json_response)) |
|
282 |
|
283 |
|
284 @login_required |
|
285 def get_user_dump(request, scope,template_name='user/dump.html'): |
|
286 """ Gets a general dump of user related info |
|
287 """ |
|
288 print request.user.is_staff |
|
289 if request.user.is_staff: |
|
290 qs=Registration.objects.all() |
|
291 rows=[] |
|
292 for obj in qs: |
|
293 row = {} |
|
294 row['first_name'] = obj.registrant.first_name |
|
295 row['last_name'] = obj.registrant.last_name |
|
296 try: |
|
297 accomodation_require = Accommodation.objects.filter(user__username=obj.registrant.username)[0] |
|
298 row['sex'] = accomodation_require.sex |
|
299 except: |
|
300 row['sex'] = 'Acco. Unspecified' |
|
301 row['city'] = obj.city |
|
302 row['organization'] = obj.organisation |
|
303 row['occupation'] = obj.occupation |
|
304 row['conference'] = obj.conference |
|
305 row['sprint'] = obj.sprint |
|
306 row['tutorial'] = obj.tutorial |
|
307 try: |
|
308 wifi_require = Wifi.objects.filter(user__username=obj.registrant.username)[0] |
|
309 row['wifi'] = wifi_require.wifi |
|
310 except: |
|
311 row['wifi']='Wifi Unspecified' |
|
312 rows.append(row) |
|
313 return render_to_response(template_name, RequestContext(request, { |
|
314 'rows': rows})) |
|
315 |
|
316 |
|
317 else: |
|
318 raise Http404 |