Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
95689ec4
Unverified
Commit
95689ec4
authored
Aug 06, 2023
by
takatost
Committed by
GitHub
Aug 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: modify app name & icon raise 401 (#759)
parent
51554361
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
16 deletions
+4
-16
app.py
api/controllers/console/app/app.py
+4
-16
No files found.
api/controllers/console/app/app.py
View file @
95689ec4
...
@@ -297,19 +297,13 @@ class AppNameApi(Resource):
...
@@ -297,19 +297,13 @@ class AppNameApi(Resource):
@
account_initialization_required
@
account_initialization_required
@
marshal_with
(
app_detail_fields
)
@
marshal_with
(
app_detail_fields
)
def
post
(
self
,
app_id
):
def
post
(
self
,
app_id
):
app_id
=
str
(
app_id
)
# The role of the current user in the ta table must be admin or owner
app
=
_get_app
(
app_id
,
current_user
.
current_tenant_id
)
if
current_user
.
current_tenant
.
current_role
not
in
[
'admin'
,
'owner'
]:
raise
Forbidden
()
parser
=
reqparse
.
RequestParser
()
parser
=
reqparse
.
RequestParser
()
parser
.
add_argument
(
'name'
,
type
=
str
,
required
=
True
,
location
=
'json'
)
parser
.
add_argument
(
'name'
,
type
=
str
,
required
=
True
,
location
=
'json'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
app
=
db
.
get_or_404
(
App
,
str
(
app_id
))
if
app
.
tenant_id
!=
flask
.
session
.
get
(
'tenant_id'
):
raise
Unauthorized
()
app
.
name
=
args
.
get
(
'name'
)
app
.
name
=
args
.
get
(
'name'
)
app
.
updated_at
=
datetime
.
utcnow
()
app
.
updated_at
=
datetime
.
utcnow
()
db
.
session
.
commit
()
db
.
session
.
commit
()
...
@@ -322,20 +316,14 @@ class AppIconApi(Resource):
...
@@ -322,20 +316,14 @@ class AppIconApi(Resource):
@
account_initialization_required
@
account_initialization_required
@
marshal_with
(
app_detail_fields
)
@
marshal_with
(
app_detail_fields
)
def
post
(
self
,
app_id
):
def
post
(
self
,
app_id
):
app_id
=
str
(
app_id
)
# The role of the current user in the ta table must be admin or owner
app
=
_get_app
(
app_id
,
current_user
.
current_tenant_id
)
if
current_user
.
current_tenant
.
current_role
not
in
[
'admin'
,
'owner'
]:
raise
Forbidden
()
parser
=
reqparse
.
RequestParser
()
parser
=
reqparse
.
RequestParser
()
parser
.
add_argument
(
'icon'
,
type
=
str
,
location
=
'json'
)
parser
.
add_argument
(
'icon'
,
type
=
str
,
location
=
'json'
)
parser
.
add_argument
(
'icon_background'
,
type
=
str
,
location
=
'json'
)
parser
.
add_argument
(
'icon_background'
,
type
=
str
,
location
=
'json'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
app
=
db
.
get_or_404
(
App
,
str
(
app_id
))
if
app
.
tenant_id
!=
flask
.
session
.
get
(
'tenant_id'
):
raise
Unauthorized
()
app
.
icon
=
args
.
get
(
'icon'
)
app
.
icon
=
args
.
get
(
'icon'
)
app
.
icon_background
=
args
.
get
(
'icon_background'
)
app
.
icon_background
=
args
.
get
(
'icon_background'
)
app
.
updated_at
=
datetime
.
utcnow
()
app
.
updated_at
=
datetime
.
utcnow
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment