[webrequest] simplify set_session code
Thanks to the previous changeset we are assured that session handed to
set_session is full featured one. This allows a simpler code for this method.
related to #2503918
--- 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 ########################################