This commit is contained in:
Aevann1 2021-12-04 22:48:10 +02:00
parent 0496e92f5b
commit 4e55a649c0
6 changed files with 27 additions and 3 deletions

View file

@ -335,8 +335,11 @@ class Submission(Base):
maxupvotes = min(ti, 27)
rand = random.randint(0, maxupvotes)
if self.upvotes < rand:
self.upvotes += random.randint(0, 3)
amount = random.randint(0, 3)
self.upvotes += amount
g.db.add(self)
self.author.coins += amount
g.db.add(self.author)
g.db.commit()
return body