From cf4ab0d09fab54ee268fa015777de22f1079ce8f Mon Sep 17 00:00:00 2001 From: John Tordoff Date: Fri, 10 May 2024 09:46:13 -0400 Subject: [PATCH] [ENG-5140] Update get_auth for GV and readability (#10584) * refactor get_auth * conditionally get credentials and settings from GravyValet --------- Co-authored-by: John Tordoff <> --- addons/base/signals.py | 2 + addons/base/views.py | 489 +++++++++++++++++++++++++++------------- tests/test_addons.py | 121 ++++++---- tests/test_preprints.py | 28 +-- 4 files changed, 413 insertions(+), 227 deletions(-) diff --git a/addons/base/signals.py b/addons/base/signals.py index 54ad7a6ad8e..2cb86aba118 100644 --- a/addons/base/signals.py +++ b/addons/base/signals.py @@ -3,3 +3,5 @@ signals = blinker.Namespace() file_updated = signals.signal('file_updated') +file_viewed = signals.signal('file_viewed') +file_downloaded = signals.signal('file_downloaded') diff --git a/addons/base/views.py b/addons/base/views.py index d3e5007166a..f9eb45615c3 100644 --- a/addons/base/views.py +++ b/addons/base/views.py @@ -65,6 +65,7 @@ # import so that associated listener is instantiated and gets emails from website.notifications.events.files import FileEvent # noqa +from osf.utils.requests import requests_retry_session ERROR_MESSAGES = {'FILE_GONE': u"""