Skip to content

Commit

Permalink
Refactor _metadata_locale to use a Locale object
Browse files Browse the repository at this point in the history
  • Loading branch information
catileptic committed Jun 23, 2023
1 parent a52b688 commit 379ab0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aleph/views/base_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _metadata_locale(locale):
# This is dumb but we agreed it with ARIJ
# https://github.com/alephdata/aleph/issues/1432
app_logo = SETTINGS.APP_LOGO
if locale.startswith("ar"):
if locale.language.startswith("ar"):
app_logo = SETTINGS.APP_LOGO_AR or app_logo

return {
Expand All @@ -59,7 +59,7 @@ def _metadata_locale(locale):
"publish": archive.can_publish,
"logo": app_logo,
"favicon": SETTINGS.APP_FAVICON,
"locale": locale,
"locale": str(locale),
"locales": locales,
},
"categories": Collection.CATEGORIES,
Expand Down Expand Up @@ -95,7 +95,7 @@ def metadata():
- System
"""
request.rate_limit = None
locale = str(get_locale())
locale = get_locale()
data = _metadata_locale(locale)
if SETTINGS.SINGLE_USER:
role = Role.load_cli_user()
Expand Down

0 comments on commit 379ab0e

Please sign in to comment.