Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
baf06d31
Commit
baf06d31
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Add user directory on registration
parent
bab479db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/auth/views.py
+19
-9
19 additions, 9 deletions
app/auth/views.py
with
19 additions
and
9 deletions
app/auth/views.py
+
19
−
9
View file @
baf06d31
from
app
import
db
from
app
import
db
from
app.email
import
send_email
from
app.email
import
send_email
from
app.models
import
User
from
app.models
import
User
from
flask
import
flash
,
redirect
,
render_template
,
request
,
url_for
from
flask
import
(
current_app
,
flash
,
redirect
,
render_template
,
request
,
url_for
)
from
flask_login
import
current_user
,
login_required
,
login_user
,
logout_user
from
flask_login
import
current_user
,
login_required
,
login_user
,
logout_user
from
.
import
auth
from
.
import
auth
from
.forms
import
(
LoginForm
,
PasswordResetForm
,
PasswordResetRequestForm
,
from
.forms
import
(
LoginForm
,
PasswordResetForm
,
PasswordResetRequestForm
,
RegistrationForm
)
RegistrationForm
)
import
os
@auth.route
(
'
/login
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@auth.route
(
'
/login
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
...
@@ -46,14 +48,22 @@ def register():
...
@@ -46,14 +48,22 @@ def register():
username
=
form
.
username
.
data
)
username
=
form
.
username
.
data
)
db
.
session
.
add
(
user
)
db
.
session
.
add
(
user
)
db
.
session
.
commit
()
db
.
session
.
commit
()
token
=
user
.
generate_confirmation_token
()
dir
=
os
.
path
.
join
(
current_app
.
config
[
'
OPAQUE_STORAGE_DIRECTORY
'
],
send_email
(
user
.
email
,
str
(
job
.
user_id
),
'
jobs
'
,
str
(
job
.
id
))
'
Confirm Your Account
'
,
try
:
'
auth/email/confirm
'
,
os
.
makedirs
(
dir
)
token
=
token
,
except
OSError
:
user
=
user
)
flash
(
'
[ERROR]!
'
)
flash
(
'
A confirmation email has been sent to you by email.
'
)
user
.
delete
()
return
redirect
(
url_for
(
'
auth.login
'
))
else
:
token
=
user
.
generate_confirmation_token
()
send_email
(
user
.
email
,
'
Confirm Your Account
'
,
'
auth/email/confirm
'
,
token
=
token
,
user
=
user
)
flash
(
'
A confirmation email has been sent to you by email.
'
)
return
redirect
(
url_for
(
'
auth.login
'
))
return
render_template
(
'
auth/register.html.j2
'
,
return
render_template
(
'
auth/register.html.j2
'
,
form
=
form
,
form
=
form
,
title
=
'
Register
'
)
title
=
'
Register
'
)
...
...
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