From 8595e2a2035c9b97b8959d2ee2700b62e6c91de3 Mon Sep 17 00:00:00 2001 From: Inga Kirschnick Date: Mon, 13 Feb 2023 10:16:44 +0100 Subject: [PATCH] Share link expiration update and small fixes --- app/corpora/routes.py | 1 + app/main/routes.py | 2 +- app/templates/corpora/corpus_public.html.j2 | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/corpora/routes.py b/app/corpora/routes.py index 5c857e61..bd65bfca 100644 --- a/app/corpora/routes.py +++ b/app/corpora/routes.py @@ -76,6 +76,7 @@ def corpus(corpus_id): return redirect(url_for('.corpus', corpus_id=corpus.id)) now = datetime.utcnow() payload = { + 'exp': now + timedelta(weeks=1), 'iat': now, 'iss': current_app.config['SERVER_NAME'], 'sub': corpus.hashid diff --git a/app/main/routes.py b/app/main/routes.py index aed63853..dd4a5007 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -33,7 +33,7 @@ def dashboard(): ] corpora = [ c.to_json_serializeable() for c - in Corpus.query.filter(Corpus.is_public == True).all() + in Corpus.query.filter(Corpus.is_public == True, Corpus.user != current_user).all() ] return render_template('main/dashboard.html.j2', title='Dashboard', users=users, corpora=corpora) diff --git a/app/templates/corpora/corpus_public.html.j2 b/app/templates/corpora/corpus_public.html.j2 index 1668e55c..a489e27a 100644 --- a/app/templates/corpora/corpus_public.html.j2 +++ b/app/templates/corpora/corpus_public.html.j2 @@ -18,7 +18,7 @@ {% endif %} {% if corpus.status.name in ['BUILT', 'STARTING_ANALYSIS_SESSION', 'RUNNING_ANALYSIS_SESSION', 'CANCELING_ANALYSIS_SESSION'] and current_user.is_following_corpus(corpus) %} - Analyse + Analyze {% endif %} @@ -44,12 +44,14 @@ + {% if current_user.is_following_corpus(corpus) %}
Corpus files
+ {% endif %} @@ -59,8 +61,10 @@ {% block scripts %} {{ super() }}