From ee9774042f2c5cf4871239587f4a212e216d91ab Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 5 Oct 2021 21:12:31 +0200 Subject: [PATCH] dfsfsd --- files/__main__.py | 3 +++ files/classes/comment.py | 7 ++----- files/classes/submission.py | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 251dd75bd..fee021a7b 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -132,3 +132,6 @@ def after_request(response): from files.routes import * + + +shadowbanned = [x[0] for x in g.db.query(User.id).options(lazyload('*')).filter(User.shadowbanned != None).all()] \ No newline at end of file diff --git a/files/classes/comment.py b/files/classes/comment.py index 60ad51b14..2f39b69f9 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -2,19 +2,16 @@ import re from urllib.parse import urlencode, urlparse, parse_qs from flask import * from sqlalchemy import * -from sqlalchemy.orm import relationship, deferred, lazyload +from sqlalchemy.orm import relationship, deferred from files.helpers.lazy import lazy from files.helpers.const import SLURS -from files.__main__ import Base +from files.__main__ import Base, shadowbanned from .flags import CommentFlag -from .user import User from os import environ import time site = environ.get("DOMAIN").strip() -shadowbanned = [x[0] for x in g.db.query(User.id).options(lazyload('*')).filter(User.shadowbanned != None).all()] - class Comment(Base): __tablename__ = "comments" diff --git a/files/classes/submission.py b/files/classes/submission.py index fba7a053d..bb7eb8a8b 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -1,19 +1,17 @@ -from flask import render_template, g +from flask import render_template from sqlalchemy import * -from sqlalchemy.orm import relationship, deferred, lazyload +from sqlalchemy.orm import relationship, deferred import re, random from urllib.parse import urlparse from files.helpers.lazy import lazy from files.helpers.const import SLURS -from files.__main__ import Base +from files.__main__ import Base, shadowbanned from .flags import Flag -from .user import User from os import environ import time site = environ.get("DOMAIN").strip() site_name = environ.get("SITE_NAME").strip() -shadowbanned = [x[0] for x in g.db.query(User.id).options(lazyload('*')).filter(User.shadowbanned != None).all()] class Submission(Base):