fix segment update issue (#1844)

Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
Jyong 2023-12-26 16:22:51 +08:00 committed by GitHub
parent 08494058e9
commit da4847c5a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1104,9 +1104,9 @@ class SegmentService:
if segment.content == content:
if document.doc_form == 'qa_model':
segment.answer = args['answer']
if args['keywords']:
if 'keywords' in args and args['keywords']:
segment.keywords = args['keywords']
if args['enabled'] is not None:
if'enabled' in args and args['enabled'] is not None:
segment.enabled = args['enabled']
db.session.add(segment)
db.session.commit()