Mercurial > libervia-website
comparison pages/social_contract/page_meta.py @ 22:5fd933e238bb
massive refactoring from camelCase -> snake_case. See backend commit log for more details
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 22 May 2023 09:11:54 +0200 |
parents | 9ce41ef66dfa |
children | e7c7327f9f25 |
comparison
equal
deleted
inserted
replaced
21:67487063f421 | 22:5fd933e238bb |
---|---|
10 social_contracts = {} | 10 social_contracts = {} |
11 | 11 |
12 | 12 |
13 def prepare_render(self, request): | 13 def prepare_render(self, request): |
14 global social_contracts | 14 global social_contracts |
15 session_data = self.host.getSessionData(request, session_iface.ISATSession) | 15 session_data = self.host.get_session_data(request, session_iface.ISATSession) |
16 if session_data.locale is None: | 16 if session_data.locale is None: |
17 locale = "en" | 17 locale = "en" |
18 else: | 18 else: |
19 locale = session_data.locale | 19 locale = session_data.locale |
20 if '_' in locale: | 20 if '_' in locale: |
22 | 22 |
23 try: | 23 try: |
24 social_contract = social_contracts[locale] | 24 social_contract = social_contracts[locale] |
25 except KeyError: | 25 except KeyError: |
26 # we don't have the document in cache | 26 # we don't have the document in cache |
27 build_path = self.host.getBuildPath(self.vhost_root.site_name) | 27 build_path = self.host.get_build_path(self.vhost_root.site_name) |
28 | 28 |
29 if locale == "fr": | 29 if locale == "fr": |
30 # main social contract is in French, so we don't have suffix in this case | 30 # main social contract is in French, so we don't have suffix in this case |
31 filename = "CONTRAT_SOCIAL.html" | 31 filename = "CONTRAT_SOCIAL.html" |
32 else: | 32 else: |