]> git.ipfire.org Git - pbs.git/blobdiff - src/web/base.py
users: Let locale attribute return the tornado locale
[pbs.git] / src / web / base.py
index 3ff7fa4b054fe200e1d9cbe986d24a9f359a5a38..8a4b46e24c72a27c7cc6a910943305285c393e1d 100644 (file)
@@ -34,13 +34,11 @@ class BaseHandler(tornado.web.RequestHandler):
                        return self.session.impersonated_user or self.session.user
 
        def get_user_locale(self):
-               # Get the locale from the user settings.
-               if self.current_user and self.current_user.locale:
-                       locale = tornado.locale.get(self.current_user.locale)
-                       if locale:
-                               return locale
+               # Get the locale from the user settings
+               if self.current_user:
+                       return self.current_user.locale
 
-               # If no locale was provided, we take what ever the browser requested.
+               # If no locale was provided, we take what ever the browser requested
                return self.get_browser_locale()
 
        @property