Fix logic error

This commit is contained in:
Patrick Jentsch 2023-03-08 10:41:54 +01:00
parent 0e7e5933cc
commit 0d7fca9b0b

View File

@ -124,7 +124,10 @@ def delete_spacy_model(spacy_nlp_pipeline_model_id):
snpm = SpaCyNLPPipelineModel.query.get(spacy_nlp_pipeline_model_id)
if snpm is None:
resonse_data = {
'message': f'"{snpm.title}" not found',
'message': (
'SpaCy NLP Pipeline Model with id'
f' "{spacy_nlp_pipeline_model_id}" not found'
),
'category': 'error'
}
response = jsonify(resonse_data)
@ -169,7 +172,10 @@ def update_spacy_nlp_pipeline_model_is_public(spacy_nlp_pipeline_model_id):
snpm = SpaCyNLPPipelineModel.query.get(spacy_nlp_pipeline_model_id)
if snpm is None:
resonse_data = {
'message': f'"{snpm.title}" not found',
'message': (
'SpaCy NLP Pipeline Model with id'
f' "{spacy_nlp_pipeline_model_id}" not found'
),
'category': 'error'
}
response = jsonify(resonse_data)
@ -283,7 +289,10 @@ def delete_tesseract_model(tesseract_ocr_pipeline_model_id):
topm = TesseractOCRPipelineModel.query.get(tesseract_ocr_pipeline_model_id)
if topm is None:
resonse_data = {
'message': f'"{topm.title}" not found',
'message': (
'Tesseract OCR Pipeline Model with id'
f' "{tesseract_ocr_pipeline_model_id}" not found'
),
'category': 'error'
}
response = jsonify(resonse_data)
@ -328,7 +337,10 @@ def update_tesseract_ocr_pipeline_model_is_public(tesseract_ocr_pipeline_model_i
topm = TesseractOCRPipelineModel.query.get(tesseract_ocr_pipeline_model_id)
if topm is None:
resonse_data = {
'message': f'"{topm.title}" not found',
'message': (
'Tesseract OCR Pipeline Model with id'
f' "{tesseract_ocr_pipeline_model_id}" not found'
),
'category': 'error'
}
response = jsonify(resonse_data)