From c1df0c4bd6ac1e5254cf79275fd1fdbf3337db34 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 26 Feb 2025 14:56:00 +0100 Subject: [PATCH] On file "kill", redirect to / rather than to now dysfunctional file page. --- src/templates/file_data.tmpl | 1 - src/ytplom/http.py | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/templates/file_data.tmpl b/src/templates/file_data.tmpl index adeaa58..f4aa050 100644 --- a/src/templates/file_data.tmpl +++ b/src/templates/file_data.tmpl @@ -133,7 +133,6 @@ td.dangerous > form > input[type=submit], td.dangerous > button { background-col
-
diff --git a/src/ytplom/http.py b/src/ytplom/http.py index 4958b1e..0e42e67 100644 --- a/src/ytplom/http.py +++ b/src/ytplom/http.py @@ -128,7 +128,7 @@ class _TaskHandler(PlomHttpHandler): file.save(conn) conn.commit() file.ensure_unlinked_if_no_living_owners(conn) - self._redirect(Path(self.postvars.first_for('redir_target'))) + self._redirect(Path('/')) def _update_file(self) -> None: if not (self.server.config.allow_file_edit # also if whitelist, … @@ -322,10 +322,8 @@ class _TaskHandler(PlomHttpHandler): with DbConn() as conn: file = VideoFile.get_one(conn, Hash.from_b64(self.path_toks[2])) self._send_rendered_template( - _NAME_TEMPLATE_FILE_DATA, - {'allow_edit': self.server.config.allow_file_edit, - 'file': file, - 'redir_target': self.path}) + _NAME_TEMPLATE_FILE_DATA, + {'allow_edit': self.server.config.allow_file_edit, 'file': file}) def _send_file_json(self) -> None: with DbConn() as conn: -- 2.30.2