Skip to content

Commit

Permalink
adds workaround for era_pro vs era db naming inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyRogers committed Jan 12, 2024
1 parent 3205e29 commit d2c0a28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion emgcli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "2.4.37"
__version__: str = "2.4.38"
11 changes: 11 additions & 0 deletions emgcli/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,17 @@ def create_secret_key(var_dir):
except KeyError:
raise KeyError("Config must container default database.")

# TODO: ensure all configs (including production webuploader yamls) use the same naming scheme.
# This is a brute workaround to make all current envs and all deployments work
if 'era_pro' in DATABASES and 'era' not in DATABASES:
DATABASES['era'] = DATABASES['era_pro']
if 'ena_pro' in DATABASES and 'ena' not in DATABASES:
DATABASES['ena'] = DATABASES['ena_pro']
if 'era' in DATABASES and 'era_pro' not in DATABASES:
DATABASES['era_pro'] = DATABASES['era']
if 'ena' in DATABASES and 'ena_pro' not in DATABASES:
DATABASES['ena_pro'] = DATABASES['ena']

# this is required to use the djang-mysql QS Hints
# https://django-mysql.readthedocs.io/en/latest/queryset_extensions.html?highlight=DJANGO_MYSQL_REWRITE_QUERIES#query-hints
DJANGO_MYSQL_REWRITE_QUERIES = True
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ max-line-length = 119
"""

[tool.bumpversion]
current_version = "2.4.37"
current_version = "2.4.38"

[[tool.bumpversion.files]]
filename = "emgcli/__init__.py"

0 comments on commit d2c0a28

Please sign in to comment.