Sfoglia il codice sorgente

fix: child chunk API 404 due to UUID type comparison (#25234)

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
tags/2.0.0-beta.2^2
kenwoodjw 1 mese fa
parent
commit
1ba69b8abf
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4
    4
      api/controllers/service_api/dataset/segment.py

+ 4
- 4
api/controllers/service_api/dataset/segment.py Vedi File

raise NotFound("Segment not found.") raise NotFound("Segment not found.")


# validate segment belongs to the specified document # validate segment belongs to the specified document
if segment.document_id != document_id:
if str(segment.document_id) != str(document_id):
raise NotFound("Document not found.") raise NotFound("Document not found.")


# check child chunk # check child chunk
raise NotFound("Child chunk not found.") raise NotFound("Child chunk not found.")


# validate child chunk belongs to the specified segment # validate child chunk belongs to the specified segment
if child_chunk.segment_id != segment.id:
if str(child_chunk.segment_id) != str(segment.id):
raise NotFound("Child chunk not found.") raise NotFound("Child chunk not found.")


try: try:
raise NotFound("Segment not found.") raise NotFound("Segment not found.")


# validate segment belongs to the specified document # validate segment belongs to the specified document
if segment.document_id != document_id:
if str(segment.document_id) != str(document_id):
raise NotFound("Segment not found.") raise NotFound("Segment not found.")


# get child chunk # get child chunk
raise NotFound("Child chunk not found.") raise NotFound("Child chunk not found.")


# validate child chunk belongs to the specified segment # validate child chunk belongs to the specified segment
if child_chunk.segment_id != segment.id:
if str(child_chunk.segment_id) != str(segment.id):
raise NotFound("Child chunk not found.") raise NotFound("Child chunk not found.")


# validate args # validate args

Loading…
Annulla
Salva