From 266a115609bfdc8a11db564aa2fe620a05b47128 Mon Sep 17 00:00:00 2001 From: Longze Chen Date: Thu, 3 Oct 2024 15:36:51 -0400 Subject: [PATCH] Re-apply patches from `develop` to `grave-valet` * Here was the original patch: https://github.com/CenterForOpenScience/osf.io/commit/55aa05577c335fcc82b279d2d9b08bf5f67a30e9 * This commit only applies the patch to `_get_authenticated_resource()` --- addons/base/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/base/views.py b/addons/base/views.py index 6f142db5781..df093ca832e 100644 --- a/addons/base/views.py +++ b/addons/base/views.py @@ -277,6 +277,9 @@ def _get_authenticated_resource(resource_id): if resource.deleted: raise HTTPError(http_status.HTTP_410_GONE, message='Resource has been deleted.') + if getattr(resource, 'is_retracted', False): + raise HTTPError(http_status.HTTP_410_GONE, message='Resource has been retracted.') + return resource