web/request.py
changeset 9041 753a159c8822
parent 9038 1b972d81eda4
child 9063 383d45cf61fa
--- a/web/request.py	Fri Jun 21 16:28:16 2013 +0200
+++ b/web/request.py	Mon Jun 24 11:31:47 2013 +0200
@@ -225,16 +225,10 @@
         """
         super(CubicWebRequestBase, self).set_session(session)
         # set request language
-        vreg = self.vreg
-        if self.user:
-            try:
-                # 1. user specified language
-                lang = vreg.typed_value('ui.language',
-                                        self.user.properties['ui.language'])
-                self.set_language(lang)
-                return
-            except KeyError:
-                pass
+        user_lang = self.user.properties.get('ui.language')
+        if user_lang is not None:
+            lang = self.vreg.typed_value('ui.language', user_lang)
+            self.set_language(lang)
 
     # input form parameters management ########################################