diff --git a/ietf/group/tasks.py b/ietf/group/tasks.py index f19246fb5..8b4c994ba 100644 --- a/ietf/group/tasks.py +++ b/ietf/group/tasks.py @@ -43,23 +43,28 @@ def generate_wg_charters_files_task(): encoding="utf8", ) - charter_copy_dest = getattr(settings, "CHARTER_COPY_PATH", None) - if charter_copy_dest is not None: - if not Path(charter_copy_dest).is_dir(): - log.log( - f"Error copying 1wg-charter files to {charter_copy_dest}: it does not exist or is not a directory" - ) - else: - try: - shutil.copy2(charters_file, charter_copy_dest) - except IOError as err: - log.log(f"Error copying {charters_file} to {charter_copy_dest}: {err}") - try: - shutil.copy2(charters_by_acronym_file, charter_copy_dest) - except IOError as err: + charter_copy_dests = [ + getattr(settings, "CHARTER_COPY_PATH", None), + getattr(settings, "CHARTER_COPY_OTHER_PATH", None), + getattr(settings, "CHARTER_COPY_THIRD_PATH", None), + ] + for charter_copy_dest in charter_copy_dests: + if charter_copy_dest is not None: + if not Path(charter_copy_dest).is_dir(): log.log( - f"Error copying {charters_by_acronym_file} to {charter_copy_dest}: {err}" + f"Error copying 1wg-charter files to {charter_copy_dest}: it does not exist or is not a directory" ) + else: + try: + shutil.copy2(charters_file, charter_copy_dest) + except IOError as err: + log.log(f"Error copying {charters_file} to {charter_copy_dest}: {err}") + try: + shutil.copy2(charters_by_acronym_file, charter_copy_dest) + except IOError as err: + log.log( + f"Error copying {charters_by_acronym_file} to {charter_copy_dest}: {err}" + ) @shared_task diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index 35c8b2b0b..32d919c77 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -62,6 +62,8 @@ class GroupPagesTests(TestCase): settings_temp_path_overrides = TestCase.settings_temp_path_overrides + [ "CHARTER_PATH", "CHARTER_COPY_PATH", + "CHARTER_COPY_OTHER_PATH", # Note: not explicitly testing use of + "CHARTER_COPY_THIRD_PATH", # either of these settings "GROUP_SUMMARY_PATH", ] diff --git a/ietf/settings.py b/ietf/settings.py index 4e678b380..efd04c606 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -744,6 +744,8 @@ INTERNET_DRAFT_PDF_PATH = '/a/www/ietf-datatracker/pdf/' RFC_PATH = '/a/www/ietf-ftp/rfc/' CHARTER_PATH = '/a/ietfdata/doc/charter/' CHARTER_COPY_PATH = '/a/www/ietf-ftp/ietf' # copy 1wg-charters files here if set +CHARTER_COPY_OTHER_PATH = '/a/www/ftp/ietf' +CHARTER_COPY_THIRD_PATH = '/a/www/ftp/charter' GROUP_SUMMARY_PATH = '/a/www/ietf-ftp/ietf' BOFREQ_PATH = '/a/ietfdata/doc/bofreq/' CONFLICT_REVIEW_PATH = '/a/ietfdata/doc/conflict-review'