Skip to content

Commit

Permalink
fixed prod/dev urls
Browse files Browse the repository at this point in the history
  • Loading branch information
albangaignard committed Sep 13, 2024
1 parent 6d25859 commit 94fd4f4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,9 +1146,12 @@ def evaluate_fc_metrics(metric_name, client_metric_id, url):
id, name, score, str(evaluation_time), comment
)

b_url = str(request.base_url)
if "socket.io" in str(request.base_url):
b_url = str(request.base_url).split("socket.io/")[0]
if app.config["ENV"] == "production":
b_url = app.config["SERVER_IP"] + "/"
else:
b_url = str(request.base_url)
if "socket.io" in str(request.base_url):
b_url = str(request.base_url).split("socket.io/")[0]

csv_line = {
"id": id,
Expand Down Expand Up @@ -1194,9 +1197,12 @@ def handle_done_fair_assessment(data):
"generatedAtTime": datetime.now(),
}

b_url = str(request.base_url)
if "socket.io" in str(request.base_url):
b_url = str(request.base_url).split("socket.io/")[0]
if app.config["ENV"] == "production":
b_url = app.config["SERVER_IP"] + "/"
else:
b_url = str(request.base_url)
if "socket.io" in str(request.base_url):
b_url = str(request.base_url).split("socket.io/")[0]

r = db_assessments.insert_one(assessment)
emit(
Expand Down

0 comments on commit 94fd4f4

Please sign in to comment.