Updated functionalities
This commit is contained in:
@@ -80,7 +80,9 @@ def index():
|
||||
@bp.route('/<int:notif_id>/mark-read', methods=['POST'])
|
||||
@login_required
|
||||
def mark_read(notif_id):
|
||||
notif = Notification.query.get_or_404(notif_id)
|
||||
notif = db.session.get(Notification, notif_id)
|
||||
if notif is None:
|
||||
abort(404)
|
||||
if notif.user_id != current_user.id:
|
||||
abort(403)
|
||||
notif.is_read = True
|
||||
|
||||
Reference in New Issue
Block a user