prohibit enable and disable function when segment is not completed (#1954)

Co-authored-by: jyong <jyong@dify.ai>
Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
Jyong
2024-01-05 18:18:38 +08:00
committed by GitHub
parent 28b26f67e2
commit 4d99c689f0
4 changed files with 6 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ def enable_segment_to_index_task(segment_id: str):
raise NotFound('Segment not found')
if segment.status != 'completed':
return
raise NotFound('Segment is not completed, enable action is not allowed.')
indexing_cache_key = 'segment_{}_indexing'.format(segment.id)