diff --git a/app/corpora/files/__init__.py b/app/corpora/files/__init__.py index 2f47a450..a52ff995 100644 --- a/app/corpora/files/__init__.py +++ b/app/corpora/files/__init__.py @@ -1,7 +1,7 @@ from flask import Blueprint -TEMPLATE_FOLDER = 'corpora/files' +template_base_dir = 'corpora/files' bp = Blueprint('files', __name__) diff --git a/app/corpora/files/routes.py b/app/corpora/files/routes.py index 7715f417..5ef4e0d0 100644 --- a/app/corpora/files/routes.py +++ b/app/corpora/files/routes.py @@ -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,