Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Krish Moodbidri
user-reg-cleanup
Commits
390e1257
Commit
390e1257
authored
Feb 26, 2020
by
Mitchell Moore
Committed by
Krish Moodbidri
Apr 10, 2020
Browse files
Make unique test username for debugging
parent
8fd86e4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/__init__.py
View file @
390e1257
...
@@ -7,6 +7,7 @@ from __future__ import print_function
...
@@ -7,6 +7,7 @@ from __future__ import print_function
import
uuid
import
uuid
from
flask
import
Flask
,
redirect
,
url_for
,
request
,
render_template
,
flash
,
session
from
flask
import
Flask
,
redirect
,
url_for
,
request
,
render_template
,
flash
,
session
from
flask_bootstrap
import
Bootstrap
from
flask_bootstrap
import
Bootstrap
import
random
def
create_app
(
config_name
):
def
create_app
(
config_name
):
...
@@ -16,7 +17,9 @@ def create_app(config_name):
...
@@ -16,7 +17,9 @@ def create_app(config_name):
@
app
.
route
(
'/'
,
methods
=
[
'GET'
,
'POST'
])
# initial route to display the reg page
@
app
.
route
(
'/'
,
methods
=
[
'GET'
,
'POST'
])
# initial route to display the reg page
def
index
():
def
index
():
global
return_url
global
return_url
username
=
"name_test"
if
'username'
not
in
session
:
session
[
'username'
]
=
"name_test"
+
str
(
random
.
randint
(
0
,
10000
))
if
'uid'
not
in
session
:
if
'uid'
not
in
session
:
session
[
'uid'
]
=
str
(
uuid
.
uuid4
())
session
[
'uid'
]
=
str
(
uuid
.
uuid4
())
...
@@ -24,7 +27,7 @@ def create_app(config_name):
...
@@ -24,7 +27,7 @@ def create_app(config_name):
if
"redir"
in
request
.
args
and
return_url
==
""
:
# check for redir arg in url
if
"redir"
in
request
.
args
and
return_url
==
""
:
# check for redir arg in url
return_url
=
request
.
args
.
get
(
"redir"
)
or
"/pun/sys/dashboard"
return_url
=
request
.
args
.
get
(
"redir"
)
or
"/pun/sys/dashboard"
return
render_template
(
"
auth/SignUp.html
"
)
return
render_template
(
'
auth/SignUp.html
'
,
user
=
session
[
'username'
],
room_id
=
session
[
'uid'
]
)
@
app
.
errorhandler
(
403
)
@
app
.
errorhandler
(
403
)
def
forbidden
(
error
):
def
forbidden
(
error
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment