imip-agent

Changeset

1029:beb6887d8035
2016-01-29 Paul Boddie raw files shortlog changelog graph Handle empty locale settings.
imipweb/resource.py (file)
     1.1 --- a/imipweb/resource.py	Fri Jan 29 22:25:02 2016 +0100
     1.2 +++ b/imipweb/resource.py	Fri Jan 29 22:54:06 2016 +0100
     1.3 @@ -3,7 +3,7 @@
     1.4  """
     1.5  Common resource functionality for Web calendar clients.
     1.6  
     1.7 -Copyright (C) 2014, 2015 Paul Boddie <paul@boddie.org.uk>
     1.8 +Copyright (C) 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
     1.9  
    1.10  This program is free software; you can redistribute it and/or modify it under
    1.11  the terms of the GNU General Public License as published by the Free Software
    1.12 @@ -183,7 +183,7 @@
    1.13  
    1.14      def get_user_locale(self):
    1.15          if not self.locale:
    1.16 -            self.locale = self.get_preferences().get("LANG", "en", True)
    1.17 +            self.locale = self.get_preferences().get("LANG", "en", True) or "en"
    1.18          return self.locale
    1.19  
    1.20      # Prettyprinting of dates and times.