mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
parent
1d8abd8f4b
commit
b9386d5a47
@ -92,3 +92,10 @@ def check_for_ban():
|
||||
elif current_user.rank == models.UserRank.NOT_JOINED:
|
||||
current_user.rank = models.UserRank.MEMBER
|
||||
models.db.session.commit()
|
||||
|
||||
from .utils import clearNotifications
|
||||
|
||||
@app.before_request
|
||||
def check_for_notifications():
|
||||
if current_user.is_authenticated:
|
||||
clearNotifications(request.path)
|
||||
|
@ -119,7 +119,6 @@ def view_editrequest_page(package, id):
|
||||
if erequest is None or erequest.package != package:
|
||||
abort(404)
|
||||
|
||||
clearNotifications(erequest.getURL())
|
||||
return render_template("packages/editrequest_view.html", package=package, request=erequest)
|
||||
|
||||
|
||||
|
@ -101,8 +101,6 @@ def getReleases(package):
|
||||
@bp.route("/packages/<author>/<name>/")
|
||||
@is_package_page
|
||||
def view(package):
|
||||
clearNotifications(package.getDetailsURL())
|
||||
|
||||
alternatives = None
|
||||
if package.type == PackageType.MOD:
|
||||
alternatives = Package.query \
|
||||
|
@ -157,8 +157,6 @@ def edit_release(package, id):
|
||||
if release is None or release.package != package:
|
||||
abort(404)
|
||||
|
||||
clearNotifications(release.getEditURL())
|
||||
|
||||
canEdit = package.checkPerm(current_user, Permission.MAKE_RELEASE)
|
||||
canApprove = package.checkPerm(current_user, Permission.APPROVE_RELEASE)
|
||||
if not (canEdit or canApprove):
|
||||
|
@ -81,8 +81,6 @@ def edit_screenshot(package, id):
|
||||
if not (canEdit or canApprove):
|
||||
return redirect(package.getDetailsURL())
|
||||
|
||||
clearNotifications(screenshot.getEditURL())
|
||||
|
||||
# Initial form class from post data and default data
|
||||
form = EditScreenshotForm(formdata=request.form, obj=screenshot)
|
||||
|
||||
|
@ -82,8 +82,6 @@ def unsubscribe(id):
|
||||
|
||||
@bp.route("/threads/<int:id>/", methods=["GET", "POST"])
|
||||
def view(id):
|
||||
clearNotifications(url_for("threads.view", id=id))
|
||||
|
||||
thread = Thread.query.get(id)
|
||||
if thread is None or not thread.checkPerm(current_user, Permission.SEE_THREAD):
|
||||
abort(404)
|
||||
|
Loading…
Reference in New Issue
Block a user