From 5fe084cdabd1b98221192175b29d53f31fef6f30 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:18:37 -0600 Subject: [PATCH] Add err handling --- .../management/commands/email_current_metadata_report.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/registrar/management/commands/email_current_metadata_report.py b/src/registrar/management/commands/email_current_metadata_report.py index 82b83ea9b..773199198 100644 --- a/src/registrar/management/commands/email_current_metadata_report.py +++ b/src/registrar/management/commands/email_current_metadata_report.py @@ -72,6 +72,10 @@ class Command(BaseCommand): # override = settings.SECRET_ENCRYPT_METADATA is None and not settings.IS_PRODUCTION # password = "devpwd" if override else settings.SECRET_ENCRYPT_METADATA password = settings.SECRET_ENCRYPT_METADATA + if not password: + raise ValueError( + "No password was specified for this zip file." + ) encrypted_zip_in_bytes = self.get_encrypted_zip(zip_filename, reports, password)