From 541796cd5c8a9db3c63a5c71854822b1acec3f15 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 7 Jun 2022 21:51:34 +0200 Subject: [PATCH] Scrub single watch --- changedetectionio/__init__.py | 13 +++++++++++++ changedetectionio/templates/edit.html | 2 ++ 2 files changed, 15 insertions(+) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 78966ad0c..45073440f 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -458,6 +458,19 @@ def changedetection_app(config=None, datastore_o=None): return 'OK' + + @app.route("/scrub/", methods=['GET']) + @login_required + def scrub_watch(uuid): + try: + datastore.scrub_watch(uuid) + except KeyError: + flash('Watch not found', 'error') + else: + flash("Cleared snapshot history for watch {}".format(uuid)) + #@todo gives 'Not enough saved change detection snapshots to produce a report.' after scrub.. interesting + return redirect(url_for('index')) + @app.route("/scrub", methods=['GET', 'POST']) @login_required def scrub_page(): diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index e39c082b9..009f6ad01 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -259,6 +259,8 @@ nav Delete + Scrub Create Copy