fsdfsd
This commit is contained in:
parent
0496e92f5b
commit
4e55a649c0
6 changed files with 27 additions and 3 deletions
|
@ -335,8 +335,11 @@ class Comment(Base):
|
|||
maxupvotes = min(ti, 31)
|
||||
rand = randint(0, maxupvotes)
|
||||
if self.upvotes < rand:
|
||||
self.upvotes += randint(0, 3)
|
||||
amount = randint(0, 3)
|
||||
self.upvotes += amount
|
||||
g.db.add(self)
|
||||
self.author.coins += amount
|
||||
g.db.add(self.author)
|
||||
g.db.commit()
|
||||
|
||||
return body
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -143,6 +143,7 @@ if SITE == 'rdrama.net':
|
|||
CARP_ID = 995
|
||||
JOAN_ID = 28
|
||||
AEVANN_ID = 1
|
||||
KLEN_ID = 2050
|
||||
LAWLZ_ID = 3833
|
||||
LLM_ID = 253
|
||||
DAD_ID = 2513
|
||||
|
@ -164,6 +165,7 @@ elif SITE == "pcmemes.net":
|
|||
CARP_ID = 0
|
||||
JOAN_ID = 0
|
||||
AEVANN_ID = 1
|
||||
KLEN_ID = 0
|
||||
LAWLZ_ID = 0
|
||||
LLM_ID = 0
|
||||
DAD_ID = 0
|
||||
|
@ -185,6 +187,7 @@ else:
|
|||
CARP_ID = 0
|
||||
JOAN_ID = 0
|
||||
AEVANN_ID = 0
|
||||
KLEN_ID = 0
|
||||
LAWLZ_ID = 0
|
||||
LLM_ID = 0
|
||||
DAD_ID = 0
|
||||
|
|
|
@ -447,6 +447,8 @@ def buy(v, award):
|
|||
@auth_required
|
||||
def award_post(pid, v):
|
||||
|
||||
if v.shadowbanned: return render_template('errors/500.html', v=v), 500
|
||||
|
||||
if v.is_banned and not v.unban_utc: return {"error": "forbidden."}, 403
|
||||
|
||||
kind = request.values.get("kind", "").strip()
|
||||
|
@ -602,6 +604,8 @@ def award_post(pid, v):
|
|||
@auth_required
|
||||
def award_comment(cid, v):
|
||||
|
||||
if v.shadowbanned: return render_template('errors/500.html', v=v), 500
|
||||
|
||||
if v.is_suspended and v.unban_utc == 0: return {"error": "forbidden"}, 403
|
||||
|
||||
kind = request.values.get("kind", "").strip()
|
||||
|
|
|
@ -19,7 +19,7 @@ def join_discord(v):
|
|||
|
||||
if v.is_suspended != 0 and v.admin_level == 0: return "Banned users cannot join the discord server!"
|
||||
|
||||
if SITE_NAME == 'Drama' and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150: return f"You must earn 150 {COINS_NAME} before entering the Discord server. You earn {COINS_NAME} by making posts/comments and getting upvoted."
|
||||
if SITE_NAME == 'Drama' and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150: return f"You must receive 150 upvotes/downvotes from other users before being able to join the Discord server."
|
||||
|
||||
if v.shadowbanned or v.agendaposter: return ""
|
||||
|
||||
|
|
|
@ -338,6 +338,17 @@ def settings_profile_post(v):
|
|||
|
||||
if len(bio_html) > 10000: abort(400)
|
||||
|
||||
if v.id == KLEN_ID:
|
||||
notify_users = NOTIFY_USERS(friends_html, v.id)
|
||||
soup = BeautifulSoup(friends_html, features="html.parser")
|
||||
for mention in soup.find_all("a", href=re.compile("^/@(\w+)")):
|
||||
username = mention["href"].split("@")[1]
|
||||
user = g.db.query(User).filter_by(username=username).first()
|
||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||
for x in notify_users:
|
||||
message = f"@{v.username} has added you to their friends list!"
|
||||
send_notification(x, message)
|
||||
|
||||
v.bio = bio[:1500]
|
||||
v.bio_html=bio_html
|
||||
g.db.add(v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue