From 6672318765d42dd1e9c3b8deb9b654f47886387d Mon Sep 17 00:00:00 2001 From: Domeniko Gentner Date: Sun, 22 Nov 2020 11:08:27 +0100 Subject: [PATCH] re-export json after administrative action --- labertasche/blueprints/bp_dashboard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/labertasche/blueprints/bp_dashboard.py b/labertasche/blueprints/bp_dashboard.py index f488779..b3b610b 100644 --- a/labertasche/blueprints/bp_dashboard.py +++ b/labertasche/blueprints/bp_dashboard.py @@ -10,7 +10,7 @@ from flask import Blueprint, render_template, request, redirect from flask_login import login_required from labertasche.database import labertasche_db as db from labertasche.models import TLocation, TComments, TEmail -from labertasche.helper import dates_of_the_week +from labertasche.helper import dates_of_the_week, export_location from sqlalchemy import func import re @@ -131,6 +131,7 @@ def dashboard_review_spam_delete_comment(location_id, comment_id): # Remove after last slash, to keep the location but get rid of the comment id url = re.match("^(.*[/])", request.referrer)[0] + export_location(location_id) return redirect(f"{url}/{location_id}") @@ -144,6 +145,7 @@ def dashboard_review_spam_allow_comment(comment_id, location_id): db.session.commit() url = re.match("^(.*[/])", request.referrer)[0] + export_location(location_id) return redirect(f"{url}/{location_id}") @@ -169,6 +171,7 @@ def dashboard_review_spam_block_mail(location_id, comment_id): db.session.commit() url = re.match("^(.*[/])", request.referrer)[0] + export_location(location_id) return redirect(f"{url}/{location_id}") @@ -198,4 +201,5 @@ def dashboard_review_spam_allow_user(location_id, comment_id): db.session.commit() url = re.match("^(.*[/])", request.referrer)[0] + export_location(location_id) return redirect(f"{url}/{location_id}")