Change template base variable name

This commit is contained in:
Patrick Jentsch 2023-03-13 12:05:35 +01:00
parent f348d1ed23
commit eec056e010
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
from flask import Blueprint
TEMPLATE_FOLDER = 'corpora/files'
template_base_dir = 'corpora/files'
bp = Blueprint('files', __name__)

View File

@ -11,7 +11,7 @@ import os
from app import db
from app.models import Corpus, CorpusFile, CorpusStatus
from ..decorators import corpus_follower_permission_required
from . import bp, TEMPLATE_FOLDER
from . import bp, template_base_dir
from .forms import CreateCorpusFileForm, UpdateCorpusFileForm
@ -58,7 +58,7 @@ def create_corpus_file(corpus_id):
flash(f'Corpus File "{corpus_file.filename}" added', category='corpus')
return '', 201, {'Location': corpus.url}
return render_template(
f'{TEMPLATE_FOLDER}/create_corpus_file.html.j2',
f'{template_base_dir}/create_corpus_file.html.j2',
corpus=corpus,
form=form,
title='Add corpus file'
@ -79,7 +79,7 @@ def corpus_file(corpus_id, corpus_file_id):
flash(f'Corpus file "{corpus_file.filename}" updated', category='corpus')
return redirect(corpus_file.corpus.url)
return render_template(
f'{TEMPLATE_FOLDER}/corpus_file.html.j2',
f'{template_base_dir}/corpus_file.html.j2',
corpus=corpus_file.corpus,
corpus_file=corpus_file,
form=form,