This commit is contained in:
Aevann1 2022-02-01 01:10:24 +02:00
parent 6fe3327d55
commit bc4939c213
6 changed files with 34 additions and 32 deletions

View file

@ -86,4 +86,20 @@ def NOTIFY_USERS2(text, v):
user = get_user(i.group(2), graceful=True)
if user and not v.any_block_exists(user): notify_users.add(user.id)
return notify_users
return notify_users
def send_admin(id, body_html):
new_comment = Comment(author_id=id,
parent_submission=None,
level=1,
sentto=0,
body_html=body_html,
)
g.db.add(new_comment)
g.db.flush()
admins = g.db.query(User).filter(User.admin_level > 2).all()
for admin in admins:
notif = Notification(comment_id=new_comment.id, user_id=admin.id)
g.db.add(notif)