mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Fix clear notifications creating null user_ids
This commit is contained in:
parent
d7ecf8041a
commit
9d1f098d8a
@ -17,7 +17,7 @@
|
||||
|
||||
from flask import Blueprint, render_template, redirect, url_for
|
||||
from flask_user import current_user, login_required
|
||||
from app.models import db
|
||||
from app.models import db, Notification
|
||||
|
||||
bp = Blueprint("notifications", __name__)
|
||||
|
||||
@ -29,6 +29,6 @@ def list_all():
|
||||
@bp.route("/notifications/clear/", methods=["POST"])
|
||||
@login_required
|
||||
def clear():
|
||||
current_user.notifications.clear()
|
||||
Notification.query.filter_by(user=current_user).delete()
|
||||
db.session.commit()
|
||||
return redirect(url_for("notifications.list_all"))
|
||||
|
Loading…
Reference in New Issue
Block a user