From: Christian Heller Date: Wed, 26 Feb 2025 13:56:00 +0000 (+0100) Subject: On file "kill", redirect to / rather than to now dysfunctional file page. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/bar%20baz.html?a=commitdiff_plain;ds=inline;p=ytplom On file "kill", redirect to / rather than to now dysfunctional file page. --- 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: