Fix model selection in HTR service page

This commit is contained in:
Patrick Jentsch 2022-05-19 09:56:14 +02:00
parent 31f91aaecb
commit 7e8f24e6bf
2 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ class AddTranskribusHTRPipelineJobForm(AddJobForm):
del self.binarization.render_kw['disabled'] del self.binarization.render_kw['disabled']
models = [ models = [
x for x in TranskribusHTRModel.query.filter().all() x for x in TranskribusHTRModel.query.filter().all()
if version in x.compatible_service_versions and (x.shared == True or x.user == current_user) if x.shared == True or x.user == current_user
] ]
self.model.choices = [('', 'Choose your option')] self.model.choices = [('', 'Choose your option')]
self.model.choices += [(x.hashid, x.transkribus_name) for x in models] self.model.choices += [(x.hashid, x.transkribus_name) for x in models]

View File

@ -210,7 +210,7 @@ def transkribus_htr_pipeline():
return make_response({'redirect_url': url_for('jobs.job', job_id=job.id)}, 201) # noqa return make_response({'redirect_url': url_for('jobs.job', job_id=job.id)}, 201) # noqa
transkribus_htr_models = [ transkribus_htr_models = [
x for x in TranskribusHTRModel.query.filter().all() x for x in TranskribusHTRModel.query.filter().all()
if version in x.compatible_service_versions and (x.shared == True or x.user == current_user) if x.shared == True or x.user == current_user
] ]
return render_template( return render_template(
f'services/transkribus_htr_pipeline.html.j2', f'services/transkribus_htr_pipeline.html.j2',
@ -287,4 +287,4 @@ def corpus_analysis():
return render_template( return render_template(
'services/corpus_analysis.html.j2', 'services/corpus_analysis.html.j2',
title='Corpus analysis' title='Corpus analysis'
) )