Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
becskasszasch-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
becskasszasch-2
Commits
bba0c7e7
Commit
bba0c7e7
authored
3 weeks ago
by
Szenes Márton Miklós
Browse files
Options
Downloads
Patches
Plain Diff
users.py cleanup
parent
c7fa0b4c
No related branches found
No related tags found
No related merge requests found
Pipeline
#52123
passed
3 weeks ago
Stage: release
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/api/users.py
+2
-10
2 additions, 10 deletions
app/api/users.py
with
2 additions
and
10 deletions
app/api/users.py
+
2
−
10
View file @
bba0c7e7
import
csv
import
io
import
json
from
flask
import
Blueprint
,
request
,
jsonify
,
Response
,
redirect
,
url_for
from
..functions
import
validate_json_fields
...
...
@@ -16,8 +13,6 @@ users = Blueprint('users', __name__, url_prefix='/users') # prefix: /api/v1/user
calc_credit
=
lambda
role
:
ADMIN_CREDIT
if
role
==
Roles
.
Admin
.
value
else
USER_CREDIT
# ------------- REST API-sítás ------------------------
# /api/users
# Felhasználók lekérdezése
@users.route
(
'
/
'
,
methods
=
[
'
GET
'
])
...
...
@@ -601,7 +596,7 @@ def get_user_role(uuid):
# /api/users/{uuid}/role
# PATCH # Megváltoztatja a felhasználó rangját
@users.route
(
'
/<string:uuid>/role
'
,
methods
=
[
'
PATCH
'
])
#
@token_required(required_role=Roles.admin.value)
@token_required
(
required_role
=
Roles
.
admin
.
value
)
def
update_user_role
(
uuid
):
"""
Felhasználó rangjának módosítása UUID alapján
...
...
@@ -684,6 +679,3 @@ def update_user_role(uuid):
db
.
session
.
commit
()
return
jsonify
({
"
success
"
:
True
,
"
message
"
:
f
"
{
selected_user
.
name
}
felhasználó mostantól
{
Roles
(
selected_user
.
role
)
}
.
"
}),
200
\ No newline at end of file
# -----------------------------------------------------
\ No newline at end of file
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