Skip to content
Snippets Groups Projects
Commit a144d11e authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Fix redefined-builtin

parent 20abd8e2
No related branches found
No related tags found
No related merge requests found
......@@ -16,10 +16,10 @@ from flask_bootstrap import Bootstrap
from flask_cors import CORS
# local imports
import vars
import messages
import app_vars
sys.path.append(vars.rabbitmq_agents_loc)
sys.path.append(app_vars.rabbitmq_agents_loc)
# pylint: disable=wrong-import-order
......@@ -41,7 +41,7 @@ def create_app(config_name):
app = Flask(
__name__, static_folder="static"
) # initialization of the flask app
CORS(app, resources={r"/*": {"origins": vars.cors_allowed_origins}})
CORS(app, resources={r"/*": {"origins": app_vars.cors_allowed_origins}})
Bootstrap(app) # allowing app to use bootstrap
def get_authorized_user():
......@@ -65,7 +65,7 @@ def create_app(config_name):
) # initial route to display the reg page
def index():
valid_eppa = vars.valid_eppa
valid_eppa = app_vars.valid_eppa
if "uid" not in session:
session["uid"] = str(uuid.uuid4())
......@@ -74,7 +74,7 @@ def create_app(config_name):
session["user"] = get_authorized_user()
session["return_url"] = request.args.get(
"redir", vars.default_referrer
"redir", app_vars.default_referrer
)
if not any(item in session["user"].get("eppa") for item in valid_eppa):
......@@ -100,7 +100,7 @@ def create_app(config_name):
fullname=session["user"].get("fullname"),
email=session["user"].get("email"),
referrer=session["return_url"],
cancel_url=vars.default_referrer,
cancel_url=app_vars.default_referrer,
cancel_msg=messages.cancel_message,
pre_certification_msg=messages.pre_certification_message,
certification_msg=messages.certification_message,
......@@ -118,7 +118,7 @@ def create_app(config_name):
fullname=session["user"].get("fullname"),
email=session["user"].get("email"),
referrer=session["return_url"],
cancel_url=vars.default_referrer,
cancel_url=app_vars.default_referrer,
welcome_msg=messages.welcome_message,
cancel_msg=messages.cancel_message,
error_msg=messages.error_message,
......
......@@ -18,7 +18,7 @@ from gevent import monkey
# local imports
# pylint: disable=wrong-import-order
import tasks
import vars
import app_vars
# pylint: enable=wrong-import-order
from app import create_app
......@@ -27,11 +27,11 @@ monkey.patch_all(subprocess=True)
config_name = os.getenv("FLASK_CONFIG")
app = create_app(config_name)
app.config["SECRET_KEY"] = vars.key
app.config["SECRET_KEY"] = app_vars.key
socketio = SocketIO(
app,
cors_allowed_origins=vars.cors_allowed_origins,
message_queue=vars.message_queue,
cors_allowed_origins=app_vars.cors_allowed_origins,
message_queue=app_vars.message_queue,
)
......
......@@ -13,16 +13,16 @@ from celery import Celery
from flask_socketio import SocketIO
# local imports
import vars
import app_vars
sys.path.append(vars.rabbitmq_agents_loc)
sys.path.append(app_vars.rabbitmq_agents_loc)
import rc_util # noqa: E402
broker_url = vars.broker_url
celery = Celery(vars.celery_app, broker=broker_url)
broker_url = app_vars.broker_url
celery = Celery(app_vars.celery_app, broker=broker_url)
socketio = SocketIO(message_queue=vars.message_queue)
socketio = SocketIO(message_queue=app_vars.message_queue)
timeout = 30
......@@ -152,7 +152,7 @@ def celery_create_account(msg, session):
# aup= msg['aup']
queuename = rc_util.encode_name(username)
updated_by = f"{username}"
host = vars.app_host
host = app_vars.app_host
print(
time.strftime("%m-%d-%Y_%H:%M:%S")
......@@ -185,7 +185,7 @@ def celery_certify_account(msg, session):
username = msg["username"]
queuename = rc_util.encode_name(username)
updated_by = f"{username}"
host = vars.app_host
host = app_vars.app_host
print(
"CERTIFY : "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment