diff --git a/src/olympia/scanners/admin.py b/src/olympia/scanners/admin.py index d54aa0dc0828..40617dd58463 100644 --- a/src/olympia/scanners/admin.py +++ b/src/olympia/scanners/admin.py @@ -56,6 +56,9 @@ from .tasks import run_scanner_query_rule +SERVICE_ACCOUNT_SHEET_URL = 'https://docs.google.com/spreadsheets/d/1VdiUAoluolqZIwvMZebaJIMqPbdewwiD-S8Z2g7gx08' + + @admin.display(description='Matched Rules') def formatted_matched_rules_with_files_and_data( obj, @@ -1118,3 +1121,12 @@ def save_model(self, request, obj, form, change): ) except Exception: # noqa: S110 (best-effort display of one-time JWT keys) pass + messages.add_message( + request, + messages.INFO, + format_html( + 'You must add this new webhook account to the ' + 'service account sheet.', + SERVICE_ACCOUNT_SHEET_URL, + ), + ) diff --git a/src/olympia/scanners/tests/test_admin.py b/src/olympia/scanners/tests/test_admin.py index 720dc3080b57..78a5f4748b8c 100644 --- a/src/olympia/scanners/tests/test_admin.py +++ b/src/olympia/scanners/tests/test_admin.py @@ -2341,6 +2341,7 @@ def test_create(self): assert b'Please note the JWT keys' in response.content assert api_key.key.encode() in response.content assert api_key.secret.encode() in response.content + assert b'service account sheet' in response.content response = self.client.post( reverse('admin:scanners_scannerwebhook_change', args=(webhook.pk,)),