mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 00:50:40 +00:00
add all files for last commit
This commit is contained in:
@ -55,7 +55,6 @@ class CreateTesseractOCRPipelineModelForm(ContributionBaseForm):
|
||||
)
|
||||
|
||||
def validate_tesseract_model_file(self, field):
|
||||
current_app.logger.warning(field.data.filename)
|
||||
if not field.data.filename.lower().endswith('.traineddata'):
|
||||
raise ValidationError('traineddata files only!')
|
||||
|
||||
@ -80,7 +79,6 @@ class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm):
|
||||
)
|
||||
|
||||
def validate_spacy_model_file(self, field):
|
||||
current_app.logger.warning(field.data.filename)
|
||||
if not field.data.filename.lower().endswith('.tar.gz'):
|
||||
raise ValidationError('.tar.gz files only!')
|
||||
|
||||
|
@ -104,7 +104,7 @@ def create_tesseract_ocr_pipeline_model():
|
||||
publisher_url=form.publisher_url.data,
|
||||
publishing_url=form.publishing_url.data,
|
||||
publishing_year=form.publishing_year.data,
|
||||
shared=False,
|
||||
is_public=False,
|
||||
title=form.title.data,
|
||||
version=form.version.data,
|
||||
user=current_user
|
||||
@ -131,7 +131,7 @@ def toggle_tesseract_ocr_pipeline_model_public_status(tesseract_ocr_pipeline_mod
|
||||
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)
|
||||
tesseract_ocr_pipeline_model.shared = not tesseract_ocr_pipeline_model.shared
|
||||
tesseract_ocr_pipeline_model.is_public = not tesseract_ocr_pipeline_model.is_public
|
||||
db.session.commit()
|
||||
return {}, 201
|
||||
|
||||
@ -201,7 +201,7 @@ def create_spacy_nlp_pipeline_model():
|
||||
publisher_url=form.publisher_url.data,
|
||||
publishing_url=form.publishing_url.data,
|
||||
publishing_year=form.publishing_year.data,
|
||||
shared=False,
|
||||
is_public=False,
|
||||
title=form.title.data,
|
||||
version=form.version.data,
|
||||
user=current_user
|
||||
@ -228,6 +228,6 @@ 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)
|
||||
spacy_nlp_pipeline_model.shared = not spacy_nlp_pipeline_model.shared
|
||||
spacy_nlp_pipeline_model.is_public = not spacy_nlp_pipeline_model.is_public
|
||||
db.session.commit()
|
||||
return {}, 201
|
||||
|
Reference in New Issue
Block a user