summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-02 13:44:32 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-02 15:05:30 +0200
commit7039b2942611f605f610888e6c7970135f4b67e4 (patch)
tree6485419876674dd7548972ed81cff1a54e22bf21 /ogcp/views.py
parenta9bbb10e8402d99b009f1ea95b38a7b228b2d83b (diff)
Store configuration file path on a global variable
Otherwise, users may change the file path on one place of the code and forget to change the other places.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 16cdfd1..9641ed0 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -28,7 +28,7 @@ from ogcp.forms.auth import LoginForm, UserForm, DeleteUserForm
from ogcp.og_server import servers
from flask_babel import lazy_gettext as _l
from flask_babel import _
-from ogcp import app
+from ogcp import app, ogcp_cfg_path
import requests
import datetime
import hashlib
@@ -1486,7 +1486,7 @@ def save_user(form):
'SCOPES': scopes,
}
- filename = os.path.join(app.root_path, 'cfg', 'ogcp.json')
+ filename = os.path.join(app.root_path, ogcp_cfg_path)
with open(filename, 'r+') as file:
config = json.load(file)
@@ -1504,7 +1504,7 @@ def save_user(form):
def delete_user(username):
user = get_user(username)
- filename = os.path.join(app.root_path, 'cfg', 'ogcp.json')
+ filename = os.path.join(app.root_path, ogcp_cfg_path)
with open(filename, 'r+') as file:
config = json.load(file)