gdf
This commit is contained in:
parent
5d47158e5f
commit
661bc9f045
6 changed files with 57 additions and 26 deletions
|
@ -86,21 +86,4 @@ 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
|
||||
|
||||
def send_admin(id, body_html, vid=None):
|
||||
|
||||
new_comment = Comment(author_id=id,
|
||||
parent_submission=None,
|
||||
level=1,
|
||||
sentto=2,
|
||||
body_html=body_html,
|
||||
)
|
||||
g.db.add(new_comment)
|
||||
g.db.flush()
|
||||
|
||||
if vid: admins = g.db.query(User).filter(User.admin_level > 2, User.id != vid).all()
|
||||
else: 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)
|
||||
return notify_users
|
Loading…
Add table
Add a link
Reference in a new issue