fdsfds
This commit is contained in:
parent
ba8931cb7f
commit
2d8f871d51
2 changed files with 16 additions and 5 deletions
|
@ -13,11 +13,13 @@ def send_notification(uid, text, autojanny=False):
|
||||||
text_html = CustomRenderer().render(mistletoe.Document(text))
|
text_html = CustomRenderer().render(mistletoe.Document(text))
|
||||||
text_html = sanitize(text_html)
|
text_html = sanitize(text_html)
|
||||||
|
|
||||||
if autojanny: author_id = AUTOJANNY_ID
|
author_id = AUTOJANNY_ID
|
||||||
else:
|
|
||||||
author_id = NOTIFICATIONS_ID
|
# if autojanny: author_id = AUTOJANNY_ID
|
||||||
existing = g.db.query(Comment.id).filter(Comment.author_id == author_id, Comment.body_html == text_html, Comment.notifiedto == uid).first()
|
# else:
|
||||||
if existing: return
|
# author_id = NOTIFICATIONS_ID
|
||||||
|
# existing = g.db.query(Comment.id).filter(Comment.author_id == author_id, Comment.body_html == text_html, Comment.notifiedto == uid).first()
|
||||||
|
# if existing: return
|
||||||
|
|
||||||
new_comment = Comment(author_id=author_id,
|
new_comment = Comment(author_id=author_id,
|
||||||
parent_submission=None,
|
parent_submission=None,
|
||||||
|
|
|
@ -21,6 +21,15 @@ SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||||
if SITE_NAME == 'PCM': cc = "splash mountain"
|
if SITE_NAME == 'PCM': cc = "splash mountain"
|
||||||
else: cc = "country club"
|
else: cc = "country club"
|
||||||
|
|
||||||
|
@app.get("/notify")
|
||||||
|
@admin_level_required(3)
|
||||||
|
def notify(v):
|
||||||
|
users = (x[0] for x in g.db.query(User.id).all())
|
||||||
|
for u in users:
|
||||||
|
send_notification(u, f"IMPORTANT: https://rdrama.net/post/30782/psa-make-sure-you-know-your")
|
||||||
|
g.db.commit()
|
||||||
|
return "sex"
|
||||||
|
|
||||||
@app.get("/distribute/<cid>")
|
@app.get("/distribute/<cid>")
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
def distribute(v, cid):
|
def distribute(v, cid):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue