Permalink
Browse files

Fixed a couple of cases where language_pref_id wasn't being set prope…

…rly.
  • Loading branch information...
1 parent 01fee78 commit ff104887114d1539db0b4319bd9fe86fb3b5db8a @malcolmt committed Sep 28, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 minerva/views.py
View
@@ -44,10 +44,12 @@ def question(request):
query= {}
if request.user.is_authenticated():
query['student'] = request.user
- language_id = str(Profile.objects.get(user=request.user).language_pref)
+ language_id = Profile.objects.get(user=request.user).language_pref_id
+ if language_id is None:
+ language_id = 1
else:
query['anon_student'] = request.session.session_key
- language_id = request.session.get('language_id', '1')
+ language_id = request.session.get('language_id', 1)
if request.method == 'POST':
result = validate_answer(request, query)

0 comments on commit ff10488

Please sign in to comment.