From 666870e0a34d568292823d466e65d60d07c90696 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 8 May 2022 07:14:24 +0200 Subject: [PATCH] fsd --- files/helpers/jinja2.py | 3 ++- files/routes/comments.py | 2 +- files/routes/settings.py | 4 +--- files/templates/settings_profile.html | 6 +++++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index c2786f67f..1cec597c8 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -3,6 +3,7 @@ from .get import * from os import listdir, environ from .const import * import time +from datetime import datetime @app.template_filter("post_embed") def post_embed(id, v): @@ -49,4 +50,4 @@ def timestamp(timestamp): @app.context_processor def inject_constants(): - return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "ADMIGGERS":ADMIGGERS} \ No newline at end of file + return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "ADMIGGERS":ADMIGGERS, "datetime":datetime} \ No newline at end of file diff --git a/files/routes/comments.py b/files/routes/comments.py index 17f2a27c4..05d20b93f 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -496,7 +496,7 @@ def api_comment(v): g.db.add(n) - if SITE_NAME == 'rDrama' and len(c.body) >= 1000 and "<" not in body and "" not in body_html: + if SITE_NAME == 'rDrama' and len(c.body.split()) >= 200 and "<" not in body and "" not in body_html: body = random.choice(LONGPOST_REPLIES) diff --git a/files/routes/settings.py b/files/routes/settings.py index 3e58161f4..87e90323f 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -901,6 +901,4 @@ def settings(v): @app.get("/settings/profile") @auth_required def settings_profile(v): - if v.flairchanged: ti = datetime.utcfromtimestamp(v.flairchanged).strftime('%Y-%m-%d %H:%M:%S') - else: ti = '' - return render_template("settings_profile.html", v=v, ti=ti) \ No newline at end of file + return render_template("settings_profile.html", v=v) \ No newline at end of file diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 05932e7f4..45c4676af 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -448,7 +448,11 @@
- + + {% if v.flairchanged %} + {% set ti = datetime.utcfromtimestamp(v.flairchanged).strftime('%Y-%m-%d %H:%M:%S') %} + {% endif %} +