Skip to content
Snippets Groups Projects

Backend fix login

Merged roarusko requested to merge backend-fix-login into staging
1 file
+ 20
21
Compare changes
  • Side-by-side
  • Inline
+ 20
21
@@ -162,27 +162,26 @@ def _get_datastore_client(default_namespace: bool = False):
stored in the environment variable 'DEPLOYMENT_ENVIRONMENT" or defalut if the
variable is unset"""
# # If running in app engine
# if os.getenv('GAE_ENV', '').startswith('standard'):
# if default_namespace:
# client = datastore.Client(namespace=None)
# logging.info(f"Instantiating datastore client with default namespace")
# else:
# namespace=os.getenv('GAE_SERVICE')
# client = datastore.Client(namespace=namespace)
# logging.info(f"Instantiating datastore client with namespace: {namespace}")
# else:
# # If running on local machine or testing environment
# os.environ["DATASTORE_PROJECT_ID"] = "emulated-project"
# from google.auth.credentials import AnonymousCredentials
# client = datastore.Client(
# project="emulated-project",
# namespace='ns_test',
# credentials=None
# )
client = datastore.Client()
# If running in app engine
if os.getenv('GAE_ENV', '').startswith('standard'):
if default_namespace:
client = datastore.Client(namespace=None)
logging.info(f"Instantiating datastore client with default namespace")
else:
namespace=os.getenv('GAE_SERVICE')
client = datastore.Client(namespace=namespace)
logging.info(f"Instantiating datastore client with namespace: {namespace}")
else:
# If running on local machine or testing environment
os.environ["DATASTORE_PROJECT_ID"] = "emulated-project"
from google.auth.credentials import AnonymousCredentials
client = datastore.Client(
project="emulated-project",
namespace='ns_test',
credentials=None
)
return client
Loading