Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NACSOS Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MCC APSIS
NACSOS
NACSOS Core
Merge requests
!41
Master
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Master
master
into
production
Overview
0
Commits
6
Pipelines
1
Changes
1
Merged
Tim Repke
requested to merge
master
into
production
1 year ago
Overview
0
Commits
6
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Viewing commit
6a531ff8
Prev
Next
Show latest version
1 file
+
2
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
6a531ff8
improve security handling and add token handling options
· 6a531ff8
Tim Repke
authored
1 year ago
server/api/routes/users.py
+
2
−
2
Options
@@ -78,11 +78,11 @@ async def save_user(user: UserInDBModel | UserModel, current_user: UserModel = D
@router.put
(
'
/my-details
'
,
response_model
=
str
)
async
def
save_user_self
(
user
:
UserInDBModel
|
UserModel
,
current_user
:
UserModel
=
Depends
(
get_current_active_user
)):
if
current_user
.
user_id
!=
user
.
user_id
:
if
str
(
current_user
.
user_id
)
!=
str
(
user
.
user_id
)
:
raise
UserPermissionError
(
'
This is not you!
'
)
async
with
db_engine
.
session
()
as
session
:
# type: AsyncSession
user_db
:
User
|
None
=
(
await
session
.
scalars
(
select
(
User
).
where
(
User
.
user_id
==
user
.
user_id
))).
one_or_none
()
user_db
:
User
|
None
=
(
await
session
.
scalars
(
select
(
User
).
where
(
User
.
user_id
==
str
(
user
.
user_id
)))
)
.
one_or_none
()
password
:
str
|
None
=
getattr
(
user
,
'
password
'
,
None
)
if
password
is
not
None
:
Loading