mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 18:59:07 +08:00
fix: save site setting not work (#14700)
This commit is contained in:
parent
7259c0d69f
commit
4125e575af
@ -2,7 +2,6 @@ from datetime import UTC, datetime
|
|||||||
|
|
||||||
from flask_login import current_user # type: ignore
|
from flask_login import current_user # type: ignore
|
||||||
from flask_restful import Resource, marshal_with, reqparse # type: ignore
|
from flask_restful import Resource, marshal_with, reqparse # type: ignore
|
||||||
from sqlalchemy.orm import Session
|
|
||||||
from werkzeug.exceptions import Forbidden, NotFound
|
from werkzeug.exceptions import Forbidden, NotFound
|
||||||
|
|
||||||
from constants.languages import supported_language
|
from constants.languages import supported_language
|
||||||
@ -51,9 +50,7 @@ class AppSite(Resource):
|
|||||||
if not current_user.is_editor:
|
if not current_user.is_editor:
|
||||||
raise Forbidden()
|
raise Forbidden()
|
||||||
|
|
||||||
with Session(db.engine) as session:
|
site = db.session.query(Site).filter(Site.app_id == app_model.id).first()
|
||||||
site = session.query(Site).filter(Site.app_id == app_model.id).first()
|
|
||||||
|
|
||||||
if not site:
|
if not site:
|
||||||
raise NotFound
|
raise NotFound
|
||||||
|
|
||||||
@ -81,7 +78,7 @@ class AppSite(Resource):
|
|||||||
|
|
||||||
site.updated_by = current_user.id
|
site.updated_by = current_user.id
|
||||||
site.updated_at = datetime.now(UTC).replace(tzinfo=None)
|
site.updated_at = datetime.now(UTC).replace(tzinfo=None)
|
||||||
session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
return site
|
return site
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user