From b6b7d79fbf13e0dfccf3d914c20b62a847b5335e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 20 Dec 2021 14:48:02 +0200 Subject: [PATCH] fsdfsd --- files/routes/settings.py | 7 ++++--- files/routes/static.py | 8 ++++---- files/templates/CHRISTMAS/dropdowns/NavbarExtraLinks.html | 2 +- files/templates/CHRISTMAS/header.html | 4 ++-- files/templates/header.html | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index c64b658de0..b8705a7cde 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -1054,9 +1054,10 @@ def settings_song_change(v): id = song.split("v=")[1] elif song.startswith("https://youtu.be/"): id = song.split("https://youtu.be/")[1] - if not v or v.oldsite: template = '' - else: template = 'CHRISTMAS/' - return render_template(f"{template}settings_profile.html", v=v, error=f"Not a youtube link.") + else: + if not v or v.oldsite: template = '' + else: template = 'CHRISTMAS/' + return render_template(f"{template}settings_profile.html", v=v, error=f"Not a youtube link.") if "?" in id: id = id.split("?")[0] if "&" in id: id = id.split("&")[0] diff --git a/files/routes/static.py b/files/routes/static.py index 27797366e4..b352c0c1be 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -1,7 +1,7 @@ from files.mail import * from files.__main__ import app, limiter, mail from files.helpers.alerts import * -from files.helpers.const import BADGES +from files.helpers.const import * from files.classes.award import AWARDS from sqlalchemy import func from os import path @@ -56,11 +56,11 @@ def participation_stats(v): "removed_posts": g.db.query(Submission.id).filter_by(is_banned=True).count(), "deleted_posts": g.db.query(Submission.id).filter(Submission.deleted_utc > 0).count(), "posts_last_24h": g.db.query(Submission.id).filter(Submission.created_utc > day).count(), - "total_comments": g.db.query(Comment.id).count(), + "total_comments": g.db.query(Comment.id).filter(Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(), "commenting_users": g.db.query(Comment.author_id).distinct().count(), "removed_comments": g.db.query(Comment.id).filter_by(is_banned=True).count(), "deleted_comments": g.db.query(Comment.id).filter(Comment.deleted_utc>0).count(), - "comments_last_24h": g.db.query(Comment.id).filter(Comment.created_utc > day).count(), + "comments_last_24h": g.db.query(Comment.id).filter(Comment.created_utc > day, Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(), "post_votes": g.db.query(Vote.id).count(), "post_voting_users": g.db.query(Vote.user_id).distinct().count(), "comment_votes": g.db.query(CommentVote.id).count(), @@ -118,7 +118,7 @@ def cached_chart(days): post_stats = [g.db.query(Submission.id).filter(Submission.created_utc < day_cutoffs[i], Submission.created_utc > day_cutoffs[i + 1], Submission.is_banned == False).count() for i in range(len(day_cutoffs) - 1)][::-1] - comment_stats = [g.db.query(Comment.id).filter(Comment.created_utc < day_cutoffs[i], Comment.created_utc > day_cutoffs[i + 1],Comment.is_banned == False, Comment.author_id != 1).count() for i in range(len(day_cutoffs) - 1)][::-1] + comment_stats = [g.db.query(Comment.id).filter(Comment.created_utc < day_cutoffs[i], Comment.created_utc > day_cutoffs[i + 1],Comment.is_banned == False, Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count() for i in range(len(day_cutoffs) - 1)][::-1] plt.rcParams["figure.figsize"] = (20,20) diff --git a/files/templates/CHRISTMAS/dropdowns/NavbarExtraLinks.html b/files/templates/CHRISTMAS/dropdowns/NavbarExtraLinks.html index 98d22c3823..62d7675e54 100644 --- a/files/templates/CHRISTMAS/dropdowns/NavbarExtraLinks.html +++ b/files/templates/CHRISTMAS/dropdowns/NavbarExtraLinks.html @@ -41,7 +41,7 @@
  • - + Android App
  • diff --git a/files/templates/CHRISTMAS/header.html b/files/templates/CHRISTMAS/header.html index ed69212be7..da61aaed35 100644 --- a/files/templates/CHRISTMAS/header.html +++ b/files/templates/CHRISTMAS/header.html @@ -111,7 +111,7 @@
    - Android app + Android app Rules @@ -175,7 +175,7 @@ - Android app + Android app Rules diff --git a/files/templates/header.html b/files/templates/header.html index 02053192a0..6625c711ab 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -112,7 +112,7 @@
    - Android app + Android app Rules @@ -176,7 +176,7 @@ - Android app + Android app Rules