df
This commit is contained in:
parent
00c5d17d78
commit
6876734477
2 changed files with 13 additions and 11 deletions
|
@ -356,13 +356,14 @@ class Comment(Base):
|
||||||
|
|
||||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60:
|
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60:
|
||||||
ti = max(int((time.time() - self.created_utc)/60), 1)
|
ti = max(int((time.time() - self.created_utc)/60), 1)
|
||||||
maxupvotes = min(ti, 31)
|
maxupvotes = min(ti, 6)
|
||||||
rand = randint(0, maxupvotes)
|
rand = randint(0, maxupvotes)
|
||||||
if self.upvotes < rand:
|
if self.upvotes < rand:
|
||||||
amount = randint(0, 3)
|
amount = randint(0, 1)
|
||||||
self.upvotes += amount
|
if amount == 1:
|
||||||
g.db.add(self)
|
self.upvotes += amount
|
||||||
g.db.commit()
|
g.db.add(self)
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
for c in self.options:
|
for c in self.options:
|
||||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{c.id}" name="option"'
|
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{c.id}" name="option"'
|
||||||
|
|
|
@ -373,14 +373,15 @@ class Submission(Base):
|
||||||
|
|
||||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20:
|
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20:
|
||||||
ti = max(int((time.time() - self.created_utc)/60), 1)
|
ti = max(int((time.time() - self.created_utc)/60), 1)
|
||||||
maxupvotes = min(ti, 27)
|
maxupvotes = min(ti, 7)
|
||||||
rand = random.randint(0, maxupvotes)
|
rand = random.randint(0, maxupvotes)
|
||||||
if self.upvotes < rand:
|
if self.upvotes < rand:
|
||||||
amount = random.randint(0, 3)
|
amount = random.randint(0, 1)
|
||||||
self.views += amount*random.randint(3, 5)
|
if amount == 1:
|
||||||
self.upvotes += amount
|
self.views += amount*random.randint(3, 5)
|
||||||
g.db.add(self)
|
self.upvotes += amount
|
||||||
g.db.commit()
|
g.db.add(self)
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
for c in self.options:
|
for c in self.options:
|
||||||
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{c.id}" name="option"'
|
body += f'<div class="custom-control"><input type="checkbox" class="custom-control-input" id="{c.id}" name="option"'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue