feat: Move error responses to new function in tools.py
All checks were successful
Build Docker / BuildImage (push) Successful in 1m6s

This commit is contained in:
2025-10-11 17:39:46 +11:00
parent 00d035a0e8
commit 22cd49a012
6 changed files with 94 additions and 490 deletions

View File

@@ -4,6 +4,7 @@ import datetime
import requests
from mail import sendEmail
from sol import create_transaction
from tools import getClientIP
api_bp = Blueprint('api', __name__)
@@ -17,14 +18,6 @@ if 'time-zone' not in ncConfig:
ncConfig['time-zone'] = 10
def getClientIP(request):
x_forwarded_for = request.headers.get("X-Forwarded-For")
if x_forwarded_for:
ip = x_forwarded_for.split(",")[0]
else:
ip = request.remote_addr
return ip
def getGitCommit():
# if .git exists, get the latest commit hash
if os.path.isdir(".git"):