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
Commits
5ec0cf82
Commit
5ec0cf82
authored
2 years ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
add return
parent
529c3916
No related branches found
No related tags found
1 merge request
!3
Add routes for creating or updating users.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/api/routes/users.py
+2
-2
2 additions, 2 deletions
server/api/routes/users.py
with
2 additions
and
2 deletions
server/api/routes/users.py
+
2
−
2
View file @
5ec0cf82
...
...
@@ -58,7 +58,7 @@ async def get_users_by_ids(user_id: list[str] = Query(),
raise
UserNotFoundError
(
f
'
Users not found in DB for IDs
{
user_id
}
'
)
@router.put
(
'
/details
'
)
@router.put
(
'
/details
'
,
response_model
=
str
)
async
def
save_user
(
user
:
UserInDBModel
|
UserModel
,
current_user
:
UserModel
=
Depends
(
get_current_active_user
)):
# Users can only edit their own info, admins can edit all.
if
user
.
user_id
!=
current_user
.
user_id
and
not
current_user
.
is_superuser
:
...
...
@@ -67,4 +67,4 @@ async def save_user(user: UserInDBModel | UserModel, current_user: UserModel = D
detail
=
'
You do not have permission to perform this action.
'
,
)
await
create_or_update_user
(
user
,
engine
=
db_engine
)
return
await
create_or_update_user
(
user
,
engine
=
db_engine
)
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