feat: Move error responses to new function in tools.py
All checks were successful
Build Docker / BuildImage (push) Successful in 1m6s
All checks were successful
Build Docker / BuildImage (push) Successful in 1m6s
This commit is contained in:
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user