Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
self-reg-form
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krish Moodbidri
self-reg-form
Commits
a144d11e
Commit
a144d11e
authored
3 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Fix redefined-builtin
parent
20abd8e2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/__init__.py
+7
-7
7 additions, 7 deletions
app/__init__.py
run.py
+4
-4
4 additions, 4 deletions
run.py
tasks.py
+7
-7
7 additions, 7 deletions
tasks.py
with
18 additions
and
18 deletions
app/__init__.py
+
7
−
7
View file @
a144d11e
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
run.py
+
4
−
4
View file @
a144d11e
...
...
@@ -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
,
)
...
...
This diff is collapsed.
Click to expand it.
tasks.py
+
7
−
7
View file @
a144d11e
...
...
@@ -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 :
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment