From 9273430f9a8d2ec974d67a189ae26ee0146901ee Mon Sep 17 00:00:00 2001 From: Eragon Date: Tue, 12 Jan 2021 17:34:50 +0100 Subject: [PATCH] =?UTF-8?q?#84=20Configuration=20de=20la=20dur=C3=A9e=20av?= =?UTF-8?q?ant=20n=C3=A9cropost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/routes/forum/topic.py | 2 +- config.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/routes/forum/topic.py b/app/routes/forum/topic.py index 324015f..6a3f2e3 100644 --- a/app/routes/forum/topic.py +++ b/app/routes/forum/topic.py @@ -72,7 +72,7 @@ def forum_topic(f, page): comments = t.thread.comments.paginate(page, Thread.COMMENTS_PER_PAGE, True) - now_minus = datetime.datetime.now() - datetime.timedelta(minutes=1) + now_minus = datetime.datetime.now() - datetime.timedelta(days=V5Config.NECROPOST_LIMIT) last_updated_comment = t.thread.comments.filter(Comment.date_modified <= now_minus).first() return render('/forum/topic.html', t=t, form=form, comments=comments, last=last_updated_comment) diff --git a/config.py b/config.py index 4248053..7110ba9 100644 --- a/config.py +++ b/config.py @@ -4,6 +4,7 @@ try: from local_config import LocalConfig except ImportError: print(" \033[92mWARNING: Local config not found\033[0m") + class LocalConfig(): pass @@ -25,6 +26,7 @@ class Config(object): # Do not attach cookies to cross-origin requests SESSION_COOKIE_SAMESITE = "Lax" + class DefaultConfig(object): """Every value here can be overrided in the local_config.py class""" # Domain @@ -50,6 +52,9 @@ class DefaultConfig(object): # GLaDOS configuration GLADOS_HOST = "127.0.0.1" GLADOS_PORT = 5555 + # Time in days before trigerring the nec + NECROPOST_LIMIT = 31 + class V5Config(LocalConfig, DefaultConfig): # Values put here cannot be overidden with local_config