Skip to content

Commit 00b1e72

Browse files
author
matthias_schaub
committed
Correct wrong import location.
1 parent 5b864ed commit 00b1e72

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

mapswipe_workers/mapswipe_workers/utils/user_management.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
from requests.exceptions import HTTPError
66

77
from mapswipe_workers.auth import firebaseDB
8-
from mapswipe_workers.definitions import CustomError
9-
from mapswipe_workers.definitions import logger
10-
from mapswipe_workers.auth import load_config
8+
from mapswipe_workers.definitions import (
9+
CustomError,
10+
logger,
11+
CONFIG
12+
)
1113

1214

1315
def set_project_manager_rights(email):
@@ -92,8 +94,7 @@ def delete_user(email):
9294

9395

9496
def sign_in_with_email_and_password(email, password):
95-
config = load_config()
96-
api_key = config['firebase']['api_key']
97+
api_key = CONFIG['firebase']['api_key']
9798
request_ref = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key={0}".format(api_key)
9899
headers = {"content-type": "application/json; charset=UTF-8"}
99100
data = json.dumps({"email": email, "password": password, "returnSecureToken": True})
@@ -104,8 +105,7 @@ def sign_in_with_email_and_password(email, password):
104105

105106

106107
def get_firebase_db(path, custom_arguments=None, token=None):
107-
config = load_config()
108-
databaseName = config['firebase']['database_name']
108+
databaseName = CONFIG['firebase']['database_name']
109109
database_url = f'https://{databaseName}.firebaseio.com'
110110
request_ref = '{0}{1}.json?{3}auth={2}'.format(database_url, path, token, custom_arguments)
111111
headers = {"content-type": "application/json; charset=UTF-8"}
@@ -122,8 +122,7 @@ def get_firebase_db(path, custom_arguments=None, token=None):
122122

123123

124124
def set_firebase_db(path, data, token=None):
125-
config = load_config()
126-
databaseName = config['firebase']['database_name']
125+
databaseName = CONFIG['firebase']['database_name']
127126
database_url = f'https://{databaseName}.firebaseio.com'
128127
request_ref = '{0}{1}.json?auth={2}'.format(database_url, path, token)
129128
headers = {"content-type": "application/json; charset=UTF-8"}
@@ -141,8 +140,7 @@ def set_firebase_db(path, data, token=None):
141140

142141

143142
def update_firebase_db(path, data, token=None):
144-
config = load_config()
145-
databaseName = config['firebase']['database_name']
143+
databaseName = CONFIG['firebase']['database_name']
146144
database_url = f'https://{databaseName}.firebaseio.com'
147145
request_ref = '{0}{1}.json?auth={2}'.format(database_url, path, token)
148146
headers = {"content-type": "application/json; charset=UTF-8"}

0 commit comments

Comments
 (0)