mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	Adjustment Contribution Package
This commit is contained in:
		@@ -11,7 +11,7 @@ from wtforms.validators import InputRequired, Length
 | 
			
		||||
from app.services import SERVICES
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ContributionForm(FlaskForm):
 | 
			
		||||
class TesseractOCRModelContributionForm(FlaskForm):
 | 
			
		||||
    title = StringField(
 | 
			
		||||
        'Title',
 | 
			
		||||
        validators=[InputRequired(), Length(max=64)]
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,9 @@ from flask import abort, flash, Markup, render_template, url_for
 | 
			
		||||
from flask_login import login_required
 | 
			
		||||
from app import db
 | 
			
		||||
from app.decorators import permission_required
 | 
			
		||||
from app.models import TesseractOCRModel, Permission
 | 
			
		||||
from app.models import TesseractOCRPipelineModel, Permission
 | 
			
		||||
from . import bp
 | 
			
		||||
from .forms import ContributionForm
 | 
			
		||||
from .forms import TesseractOCRModelContributionForm
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.before_request
 | 
			
		||||
@@ -21,7 +21,7 @@ def contributions():
 | 
			
		||||
 | 
			
		||||
@bp.route('/tesseract-ocr-pipeline-models', methods=['GET', 'POST'])
 | 
			
		||||
def tesseract_ocr_pipeline_models():
 | 
			
		||||
    form = ContributionForm(
 | 
			
		||||
    form = TesseractOCRModelContributionForm(
 | 
			
		||||
        prefix='contribute-tesseract-ocr-pipeline-model-form'
 | 
			
		||||
    )
 | 
			
		||||
    if form.is_submitted():
 | 
			
		||||
@@ -29,7 +29,7 @@ def tesseract_ocr_pipeline_models():
 | 
			
		||||
            response = {'errors': form.errors}
 | 
			
		||||
            return response, 400
 | 
			
		||||
        try:
 | 
			
		||||
            tesseract_ocr_model = TesseractOCRModel.create(
 | 
			
		||||
            tesseract_ocr_model = TesseractOCRPipelineModel.create(
 | 
			
		||||
                form.file.data,
 | 
			
		||||
                compatible_service_versions=form.compatible_service_versions.data,
 | 
			
		||||
                description=form.description.data,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user