platzky 1.3.0__tar.gz → 1.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {platzky-1.3.0 → platzky-1.3.1}/PKG-INFO +1 -1
  2. {platzky-1.3.0 → platzky-1.3.1}/platzky/config.py +0 -2
  3. {platzky-1.3.0 → platzky-1.3.1}/platzky/engine.py +4 -10
  4. {platzky-1.3.0 → platzky-1.3.1}/pyproject.toml +1 -1
  5. {platzky-1.3.0 → platzky-1.3.1}/LICENSE +0 -0
  6. {platzky-1.3.0 → platzky-1.3.1}/README.md +0 -0
  7. {platzky-1.3.0 → platzky-1.3.1}/platzky/__init__.py +0 -0
  8. {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/admin.py +0 -0
  9. {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/fake_login.py +0 -0
  10. {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/templates/admin.html +0 -0
  11. {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/templates/login.html +0 -0
  12. {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/templates/module.html +0 -0
  13. {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/__init__.py +0 -0
  14. {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/constants.py +0 -0
  15. {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/core.py +0 -0
  16. {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/mime_validation.py +0 -0
  17. {platzky-1.3.0 → platzky-1.3.1}/platzky/blog/__init__.py +0 -0
  18. {platzky-1.3.0 → platzky-1.3.1}/platzky/blog/blog.py +0 -0
  19. {platzky-1.3.0 → platzky-1.3.1}/platzky/blog/comment_form.py +0 -0
  20. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/README.md +0 -0
  21. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/__init__.py +0 -0
  22. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/db.py +0 -0
  23. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/db_loader.py +0 -0
  24. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/github_json_db.py +0 -0
  25. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/google_json_db.py +0 -0
  26. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/graph_ql_db.py +0 -0
  27. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/json_db.py +0 -0
  28. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/json_file_db.py +0 -0
  29. {platzky-1.3.0 → platzky-1.3.1}/platzky/db/mongodb_db.py +0 -0
  30. {platzky-1.3.0 → platzky-1.3.1}/platzky/locale/en/LC_MESSAGES/messages.po +0 -0
  31. {platzky-1.3.0 → platzky-1.3.1}/platzky/locale/pl/LC_MESSAGES/messages.po +0 -0
  32. {platzky-1.3.0 → platzky-1.3.1}/platzky/models.py +0 -0
  33. {platzky-1.3.0 → platzky-1.3.1}/platzky/notifier.py +0 -0
  34. {platzky-1.3.0 → platzky-1.3.1}/platzky/platzky.py +0 -0
  35. {platzky-1.3.0 → platzky-1.3.1}/platzky/plugin/plugin.py +0 -0
  36. {platzky-1.3.0 → platzky-1.3.1}/platzky/plugin/plugin_loader.py +0 -0
  37. {platzky-1.3.0 → platzky-1.3.1}/platzky/seo/seo.py +0 -0
  38. {platzky-1.3.0 → platzky-1.3.1}/platzky/static/blog.css +0 -0
  39. {platzky-1.3.0 → platzky-1.3.1}/platzky/static/styles.css +0 -0
  40. {platzky-1.3.0 → platzky-1.3.1}/platzky/telemetry.py +0 -0
  41. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/404.html +0 -0
  42. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/base.html +0 -0
  43. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/blog.html +0 -0
  44. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/body_meta.html +0 -0
  45. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/dynamic_css.html +0 -0
  46. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/feed.xml +0 -0
  47. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/head_meta.html +0 -0
  48. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/page.html +0 -0
  49. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/post.html +0 -0
  50. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/robots.txt +0 -0
  51. {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/sitemap.xml +0 -0
  52. {platzky-1.3.0 → platzky-1.3.1}/platzky/www_handler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: platzky
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Not only blog engine
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -231,7 +231,6 @@ class Config(StrictBaseModel):
231
231
  seo_prefix: URL prefix for SEO routes
232
232
  blog_prefix: URL prefix for blog routes
233
233
  languages: Supported languages configuration
234
- domain_to_lang: Domain to language mapping
235
234
  translation_directories: Additional translation directories
236
235
  debug: Enable debug mode
237
236
  testing: Enable testing mode
@@ -247,7 +246,6 @@ class Config(StrictBaseModel):
247
246
  seo_prefix: str = Field(default="/", alias="SEO_PREFIX")
248
247
  blog_prefix: str = Field(default="/", alias="BLOG_PREFIX")
249
248
  languages: Languages = Field(default_factory=dict, alias="LANGUAGES")
250
- domain_to_lang: dict[str, str] = Field(default_factory=dict, alias="DOMAIN_TO_LANG")
251
249
  translation_directories: list[str] = Field(
252
250
  default_factory=list,
253
251
  alias="TRANSLATION_DIRECTORIES",
@@ -102,19 +102,13 @@ class Engine(Flask):
102
102
  self.dynamic_head += body
103
103
 
104
104
  def get_locale(self) -> str:
105
- domain = request.headers.get("Host", "localhost")
106
- domain_to_lang = self.config.get("DOMAIN_TO_LANG")
107
-
108
105
  languages = self.config.get("LANGUAGES", {}).keys()
109
- backup_lang = session.get(
110
- "language",
111
- request.accept_languages.best_match(languages, "en"),
112
- )
113
106
 
114
- if domain_to_lang:
115
- lang = domain_to_lang.get(domain, backup_lang)
107
+ session_lang = session.get("language")
108
+ if isinstance(session_lang, str) and session_lang in languages:
109
+ lang = session_lang
116
110
  else:
117
- lang = backup_lang
111
+ lang = request.accept_languages.best_match(languages) or "en"
118
112
 
119
113
  session["language"] = lang
120
114
  return lang
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "platzky"
3
- version = "1.3.0"
3
+ version = "1.3.1"
4
4
  description = "Not only blog engine"
5
5
  authors = []
6
6
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes