sfd
This commit is contained in:
parent
6fe3327d55
commit
bc4939c213
6 changed files with 34 additions and 32 deletions
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue