rename toggle public status routes

This commit is contained in:
Patrick Jentsch 2022-11-17 13:06:12 +01:00
parent 9c8271aec5
commit 56add67481

View File

@ -127,7 +127,7 @@ def create_tesseract_ocr_pipeline_model():
)
@bp.route('/tesseract-ocr-pipeline-models/<hashid:tesseract_ocr_pipeline_model_id>/toggle-public-status', methods=['POST'])
def share_tesseract_ocr_pipeline_model(tesseract_ocr_pipeline_model_id):
def toggle_tesseract_ocr_pipeline_model_public_status(tesseract_ocr_pipeline_model_id):
tesseract_ocr_pipeline_model = TesseractOCRPipelineModel.query.get_or_404(tesseract_ocr_pipeline_model_id)
if not (tesseract_ocr_pipeline_model.user == current_user or current_user.is_administrator()):
abort(403)
@ -223,7 +223,7 @@ def create_spacy_nlp_pipeline_model():
)
@bp.route('/spacy-nlp-pipeline-models/<hashid:spacy_nlp_pipeline_model_id>/toggle-public-status', methods=['POST'])
def share_spacy_nlp_pipeline_model(spacy_nlp_pipeline_model_id):
def toggle_spacy_nlp_pipeline_model_public_status(spacy_nlp_pipeline_model_id):
spacy_nlp_pipeline_model = SpaCyNLPPipelineModel.query.get_or_404(spacy_nlp_pipeline_model_id)
if not (spacy_nlp_pipeline_model.user == current_user or current_user.is_administrator()):
abort(403)