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
0
Issue boards
Milestones
Wiki
Code
Merge requests
3
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
fadb4415
Commit
fadb4415
authored
2 years ago
by
Krish Moodbidri
Browse files
Options
Downloads
Patches
Plain Diff
implemented logic to route user to correct page based on account state
parent
bd546112
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Feat account renewal1
Pipeline
#5803
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/__init__.py
+12
-8
12 additions, 8 deletions
app/__init__.py
with
12 additions
and
8 deletions
app/__init__.py
+
12
−
8
View file @
fadb4415
...
...
@@ -14,6 +14,9 @@ import os
import
json
import
sys
sys
.
path
.
append
(
vars
.
rabbitmq_agents_loc
)
import
rc_util
def
create_app
(
config_name
):
app
=
Flask
(
__name__
,
static_folder
=
'
static
'
)
# initialization of the flask app
cors
=
CORS
(
app
,
resources
=
{
r
"
/*
"
:
{
"
origins
"
:
vars
.
cors_allowed_origins
}})
...
...
@@ -38,7 +41,6 @@ def create_app(config_name):
def
index
():
invalid_eppa
=
[
"
staff
"
]
invalid_state
=
[
"
blocked
"
,
"
certification
"
]
if
'
uid
'
not
in
session
:
session
[
'
uid
'
]
=
str
(
uuid
.
uuid4
())
...
...
@@ -49,11 +51,14 @@ def create_app(config_name):
session
[
'
return_url
'
]
=
request
.
args
.
get
(
'
redir
'
,
vars
.
default_referrer
)
if
session
[
'
user
'
].
get
(
'
eppa
'
)
not
in
invalid_eppa
:
return
render_template
(
'
errors/blocked.html
'
,
title
=
'
shibboleth error
'
)
# if session['user'].get('eppa') not in invalid_eppa:
# return render_template('errors/blocked.html', title='shibboleth error')
if
rc_util
.
check_state
(
session
[
'
user
'
].
get
(
'
username
'
))
==
"
blocked
"
:
return
render_template
(
'
errors/blocked.html
'
)
#
if rc_util.check_state(session['user'].get('username'))
in invalid_state
:
#
return render_template('errors/er
ror.html', title='account state error
')
el
if
rc_util
.
check_state
(
session
[
'
user
'
].
get
(
'
username
'
))
==
"
certification
"
:
return
render_template
(
'
errors/
c
er
tification.html
'
)
else
:
return
render_template
(
'
auth/SignUp.html
'
,
room_id
=
session
[
'
uid
'
],
...
...
@@ -65,13 +70,12 @@ def create_app(config_name):
error_msg
=
messages
.
error_message
)
@app.route
(
'
/blocked_account
'
)
def
error_
account_
create
():
def
account_
block
():
return
render_template
(
'
errors/blocked.html
'
)
@app.route
(
'
/certify_account
'
)
def
error_
account_create
():
def
error_
certify
():
return
render_template
(
'
errors/certification.html
'
)
# misc page error catching
...
...
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