remotes/1693045480750635534/spooky-22
Aevann1 2021-11-13 23:12:07 +02:00
parent afab230985
commit f919dc52fb
2 changed files with 2 additions and 7 deletions

View File

@ -2,20 +2,18 @@ from os import environ
import re import re
import time import time
from urllib.parse import urlencode, urlparse, parse_qs from urllib.parse import urlencode, urlparse, parse_qs
from flask import * from flask import *
from sqlalchemy import * from sqlalchemy import *
from sqlalchemy.orm import relationship from sqlalchemy.orm import relationship
from files.__main__ import Base from files.__main__ import Base
from files.classes.votes import CommentVote from files.classes.votes import CommentVote
from files.helpers.const import AUTOPOLLER_ACCOUNT, censor_slurs from files.helpers.const import AUTOPOLLER_ACCOUNT, censor_slurs
from files.helpers.lazy import lazy from files.helpers.lazy import lazy
from .flags import CommentFlag from .flags import CommentFlag
from random import randint
site = environ.get("DOMAIN").strip() site = environ.get("DOMAIN").strip()
class Comment(Base): class Comment(Base):
__tablename__ = "comments" __tablename__ = "comments"
@ -328,7 +326,7 @@ class Comment(Base):
body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}") body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}")
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 600: if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 600:
rand = random.randint(5,20) rand = randint(5,20)
if self.upvotes < rand: if self.upvotes < rand:
self.upvotes = rand self.upvotes = rand
g.db.add(self) g.db.add(self)

View File

@ -3,11 +3,9 @@ import random
import re import re
import time import time
from urllib.parse import urlparse from urllib.parse import urlparse
from flask import render_template from flask import render_template
from sqlalchemy import * from sqlalchemy import *
from sqlalchemy.orm import relationship from sqlalchemy.orm import relationship
from files.__main__ import Base from files.__main__ import Base
from files.helpers.const import AUTOPOLLER_ACCOUNT, censor_slurs, TROLLTITLES from files.helpers.const import AUTOPOLLER_ACCOUNT, censor_slurs, TROLLTITLES
from files.helpers.lazy import lazy from files.helpers.lazy import lazy
@ -18,7 +16,6 @@ from flask import g
site = environ.get("DOMAIN").strip() site = environ.get("DOMAIN").strip()
site_name = environ.get("SITE_NAME").strip() site_name = environ.get("SITE_NAME").strip()
class Submission(Base): class Submission(Base):
__tablename__ = "submissions" __tablename__ = "submissions"