From c96a1716d77a1eec3760ab2ca0dfa2810b4a3192 Mon Sep 17 00:00:00 2001 From: mutantsan Date: Sun, 28 Jan 2024 09:58:03 +0200 Subject: [PATCH] fix context --- ckanext/files/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ckanext/files/views.py b/ckanext/files/views.py index b92789d..b3a7b6b 100644 --- a/ckanext/files/views.py +++ b/ckanext/files/views.py @@ -20,9 +20,13 @@ class FilesGetFileView(MethodView): def get(self, file_id: str): try: file_data = tk.get_action("files_file_show")( - {"ignore_auth": True}, {"id": file_id} + { + "user": tk.current_user.name, + "auth_user_obj": tk.current_user, + }, + {"id": file_id}, ) - except (tk.ValidationError, OSError) as e: + except (tk.ValidationError, OSError): return return tk.redirect_to(