Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Flask_User_Reg
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Mitchell Moore
Flask_User_Reg
Commits
80da3deb
Commit
80da3deb
authored
5 years ago
by
Mitchell Moore
Browse files
Options
Downloads
Patches
Plain Diff
make template functional
parent
9be1c723
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!35
Version 1b openstack rabbitmq
,
!27
WIP: Version 1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/__init__.py
+14
-10
14 additions, 10 deletions
app/__init__.py
with
14 additions
and
10 deletions
app/__init__.py
+
14
−
10
View file @
80da3deb
# app/__init__.py
# app/__init__.py
# local imports
from
__future__
import
print_function
...
...
@@ -9,10 +9,10 @@ import subprocess
import
time
# third-party imports
from
flask
import
Flask
,
redirect
,
url_for
,
request
,
render_template
,
flash
from
flask
import
Flask
,
redirect
,
url_for
,
request
,
render_template
,
flash
,
session
from
flask_wtf
import
FlaskForm
from
flask_bootstrap
import
Bootstrap
from
wtforms
import
StringField
,
SubmitField
,
validators
from
wtforms
import
StringField
,
SubmitField
,
TextAreaField
,
validators
global
time_stamp
...
...
@@ -25,8 +25,8 @@ def create_app(config_name):
return_url
=
''
class
MainForm
(
FlaskForm
):
# class for the form itself
fullname
=
StringField
(
'
Full Name:
'
,
[
validators
.
DataRequired
(),
])
reason
=
String
Field
(
'
Reason for Requesting Account:
'
,
[
validators
.
DataRequired
(),
])
fullname
=
StringField
(
'
Full Name:
'
,
[
validators
.
DataRequired
(),
validators
.
length
(
max
=
50
)
])
reason
=
TextArea
Field
(
'
Reason for Requesting Account:
'
,
[
validators
.
DataRequired
(),
validators
.
length
(
max
=
150
)
])
submit
=
SubmitField
(
'
Submit
'
)
@app.route
(
'
/
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
# initial route to display the reg page
...
...
@@ -40,17 +40,21 @@ def create_app(config_name):
fullname
=
False
form
=
MainForm
()
# initialize form object
if
form
.
is_submitted
():
fullname
=
form
.
fullname
.
data
reason
=
form
.
reason
.
data
session
[
"
fullname
"
]
=
form
.
fullname
.
data
session
[
'
reason
'
]
=
form
.
reason
.
data
form
.
fullname
.
data
=
''
# reset form data upon capture
form
.
fullname
.
data
=
''
# reset form data upon capture
return
redirect
(
url_for
(
'
success
'
,
username
=
str
(
username
)
,
fullname
=
fullname
,
reason
=
reason
)
)
return
redirect
(
url_for
(
'
success
'
,
username
=
username
))
return
render_template
(
'
auth/SignUp.html
'
,
form
=
form
,
user
=
username
)
@app.route
(
'
/success/<username>/<fullname>
'
)
def
success
(
username
,
fullname
,
reason
):
@app.route
(
'
/success/<username>
'
)
def
success
(
username
):
fullname
=
session
.
get
(
'
fullname
'
,
None
)
reason
=
session
.
get
(
'
reason
'
,
None
)
global
return_url
global
time_stamp
...
...
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