From fbf663fee38cca9fd9704f93920628b62d829f8c Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Mon, 15 May 2023 12:22:38 +0200 Subject: [PATCH] fix corpus reset cli command --- app/corpora/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/corpora/cli.py b/app/corpora/cli.py index d21e8289..67658825 100644 --- a/app/corpora/cli.py +++ b/app/corpora/cli.py @@ -1,6 +1,7 @@ from app.models import Corpus, CorpusStatus import os import shutil +from app import db from . import bp @@ -16,6 +17,8 @@ def reset(): CorpusStatus.CANCELING_ANALYSIS_SESSION ] for corpus in [x for x in Corpus.query.all() if x.status in status]: + print(f'Resetting corpus {corpus}') shutil.rmtree(os.path.join(corpus.path, 'cwb'), ignore_errors=True) - corpus.status = CorpusStatus.SUBMITTED + corpus.status = CorpusStatus.UNPREPARED corpus.num_analysis_sessions = 0 + db.session.commit()