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
7
Issue boards
Milestones
Wiki
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
rc
self-reg-form
Commits
96aad0c5
Commit
96aad0c5
authored
2 years ago
by
Krish Moodbidri
Browse files
Options
Downloads
Patches
Plain Diff
added rc_util import
parent
878865a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!21
Feat certify account
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/__init__.py
+7
-4
7 additions, 4 deletions
app/__init__.py
with
7 additions
and
4 deletions
app/__init__.py
+
7
−
4
View file @
96aad0c5
...
...
@@ -12,6 +12,10 @@ from flask_bootstrap import Bootstrap
import
random
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
...
...
@@ -36,7 +40,7 @@ def create_app(config_name):
@app.route
(
'
/
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
# initial route to display the reg page
def
index
():
invalid_eppa
=
[
"
staff
"
]
invalid_eppa
=
[
"
staff
"
,
"
affiliate
"
]
if
'
uid
'
not
in
session
:
session
[
'
uid
'
]
=
str
(
uuid
.
uuid4
())
...
...
@@ -46,9 +50,8 @@ 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
(
any
(
item
in
session
[
'
user
'
].
get
(
'
eppa
'
)
for
item
in
invalid_eppa
)):
return
render_template
(
'
errors/shibboleth.html
'
,
title
=
'
shibboleth error
'
)
if
rc_util
.
check_state
(
session
[
'
user
'
].
get
(
'
username
'
))
==
"
blocked
"
:
return
render_template
(
'
errors/blocked.html
'
)
...
...
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