Skip to content

Commit

Permalink
fix for container names
Browse files Browse the repository at this point in the history
  • Loading branch information
AppElent committed Feb 17, 2023
1 parent 7ef2444 commit c2fbed9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion django/api/api/modules/AzureCosmosDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ def load(self, access_key):
try:
environment = str(os.getenv("ENVIRONMENT") or "LOCAL").lower()
cosmos_access_key = access_key if access_key else os.getenv('cosmos-access-key') or ''
container_name = "providers_" + environment
environment_shortname = environment
if environment == 'development':
environment_shortname = 'dev'
elif environment == 'production':
environment_shortname = 'prd'
container_name = "providers_" + environment_shortname
query = "select * from " + container_name + " p"
print(environment, query)
client = CosmosClient(
Expand Down
7 changes: 6 additions & 1 deletion django/api/oauth/modules/AzureCosmosDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ def load(self, access_key):
try:
environment = str(os.getenv("ENVIRONMENT") or "LOCAL").lower()
cosmos_access_key = access_key if access_key else os.getenv('cosmos-access-key') or ''
container_name = "providers_" + environment
environment_shortname = environment
if environment == 'development':
environment_shortname = 'dev'
elif environment == 'production':
environment_shortname = 'prd'
container_name = "providers_" + environment_shortname
query = "select * from " + container_name + " p"
print(environment, query)
client = CosmosClient(
Expand Down

0 comments on commit c2fbed9

Please sign in to comment.