Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TJTS5901 K23 Template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Startuplab
Courses
TJTS5901 Continuous Software Engineering
TJTS5901 K23 Template
Commits
603ccb1b
Commit
603ccb1b
authored
2 years ago
by
Teemu Autto
Browse files
Options
Downloads
Patches
Plain Diff
Sentry user tracking.
parent
c93863ff
No related branches found
Branches containing commit
No related tags found
Loading
Pipeline
#13545
passed
2 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tjts5901/auth.py
+4
-0
4 additions, 0 deletions
src/tjts5901/auth.py
with
4 additions
and
0 deletions
src/tjts5901/auth.py
+
4
−
0
View file @
603ccb1b
...
@@ -4,6 +4,7 @@ from flask import (
...
@@ -4,6 +4,7 @@ from flask import (
Blueprint
,
flash
,
g
,
redirect
,
render_template
,
request
,
session
,
url_for
Blueprint
,
flash
,
g
,
redirect
,
render_template
,
request
,
session
,
url_for
)
)
from
werkzeug.security
import
check_password_hash
,
generate_password_hash
from
werkzeug.security
import
check_password_hash
,
generate_password_hash
from
sentry_sdk
import
set_user
from
.models
import
User
from
.models
import
User
...
@@ -21,8 +22,11 @@ def load_logged_in_user():
...
@@ -21,8 +22,11 @@ def load_logged_in_user():
if
user_id
is
None
:
if
user_id
is
None
:
g
.
user
=
None
g
.
user
=
None
set_user
(
None
)
else
:
else
:
g
.
user
=
User
.
objects
.
get
(
id
=
user_id
)
g
.
user
=
User
.
objects
.
get
(
id
=
user_id
)
set_user
({
"
id
"
:
str
(
g
.
user
.
id
),
"
email
"
:
g
.
user
.
email
})
def
login_required
(
view
):
def
login_required
(
view
):
...
...
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