forked from devs/PCv5
notifications: fixed notifications
This commit is contained in:
parent
8721a7be69
commit
358a5fec9d
|
@ -397,8 +397,7 @@ class Member(User):
|
|||
Notify a user with a message.
|
||||
An hyperlink can be added to redirect to the notification source
|
||||
"""
|
||||
# return
|
||||
n = Notification(self.id, message, href=href)
|
||||
n = Notification(self, message, href=href)
|
||||
db.session.add(n)
|
||||
db.session.commit()
|
||||
|
||||
|
|
|
@ -78,8 +78,14 @@ def adm_logout_as():
|
|||
flash("Vous avez vraiment agi de manière stupide.", "error")
|
||||
abort(403)
|
||||
|
||||
victim_name = current_user.name
|
||||
user = Member.query.get(id)
|
||||
|
||||
# Send a notification to vandalized user
|
||||
current_user.notify(f"{user.name} a accédé à ce compte à des fins de modération",
|
||||
url_for('user', username=user.name))
|
||||
|
||||
# Switch back to admin
|
||||
victim_name = current_user.name
|
||||
logout_user()
|
||||
login_user(user)
|
||||
|
||||
|
|
Loading…
Reference in New Issue