Navigation Menu

Skip to content

Commit

Permalink
Raising exception when getting shared state of uninitialized LocaleBorg.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Sep 11, 2015
1 parent 53e4f21 commit b22ea79
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nikola/utils.py
Expand Up @@ -1056,6 +1056,8 @@ def initialize(cls, locales, initial_lang):
cls.initialized = True

def __get_shared_state(self):
if not self.initialized:
raise LocaleBorgUninitializedException()
shared_state = getattr(self.__thread_local, 'shared_state', None)
if shared_state is None:
shared_state = {'current_lang': self.__initial_lang}
Expand Down

0 comments on commit b22ea79

Please sign in to comment.