From a1c4631a4e6df39c308726acc6643c9cc76bd1d0 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 2 Oct 2024 12:08:17 -0400 Subject: [PATCH] resolve merge conflict errors --- tdrs-backend/tdpservice/data_files/admin/admin.py | 3 +-- .../static/admin/js/admin/admin_datafile_model.js | 3 --- .../management/commands/clean_and_reparse.py | 8 ++++++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tdrs-backend/tdpservice/data_files/admin/admin.py b/tdrs-backend/tdpservice/data_files/admin/admin.py index 995f3e8e9..f17e0d6f1 100644 --- a/tdrs-backend/tdpservice/data_files/admin/admin.py +++ b/tdrs-backend/tdpservice/data_files/admin/admin.py @@ -58,8 +58,7 @@ def get_actions(self, request): """Return the actions.""" actions = super().get_actions(request) if not request.user.groups.filter(name__in=["OFA System Admin", "OFA Admin"]).exists(): - if "reparse" in actions: - del actions["reparse"] + actions.pop("reparse", None) else: if "reparse" not in actions: actions["reparse"] = (self.reparse, "reparse", "Reparse selected data files)") diff --git a/tdrs-backend/tdpservice/data_files/static/admin/js/admin/admin_datafile_model.js b/tdrs-backend/tdpservice/data_files/static/admin/js/admin/admin_datafile_model.js index 709b52b09..6c16846ce 100644 --- a/tdrs-backend/tdpservice/data_files/static/admin/js/admin/admin_datafile_model.js +++ b/tdrs-backend/tdpservice/data_files/static/admin/js/admin/admin_datafile_model.js @@ -2,18 +2,15 @@ $(window).on('load', function() { //your code here console.log('loaded'); var submitBtn=document.querySelector('button[type=submit]'); // add the first listener - console.log(submitBtn.parentNode); var theForm = submitBtn.parentNode.parentNode; for (var i = 0; i < theForm.childNodes.length; i++) { - console.log(theForm.childNodes[i].className) if (theForm.childNodes[i].className == "actions") { form_header = theForm.childNodes[i]; break; } } for (var i = 0; i < form_header.childNodes.length; i++) { - console.log(form_header.childNodes[i].className) if (form_header.childNodes[i].className == "action-counter") { number_of_files = form_header.childNodes[i]; break; diff --git a/tdrs-backend/tdpservice/search_indexes/management/commands/clean_and_reparse.py b/tdrs-backend/tdpservice/search_indexes/management/commands/clean_and_reparse.py index 42988ea10..ab707335c 100644 --- a/tdrs-backend/tdpservice/search_indexes/management/commands/clean_and_reparse.py +++ b/tdrs-backend/tdpservice/search_indexes/management/commands/clean_and_reparse.py @@ -306,7 +306,10 @@ def handle(self, *args, **options): selected_files = [int(file) for file in selected_files[0].split(',')] if selected_files else None new_indices = reparse_all is True - # have to check if the selected_files is not None + # Option that can only be specified by calling `handle` directly and passing it. + testing = options.get('testing', False) + ## + args_passed = fiscal_year is not None or fiscal_quarter is not None or reparse_all or selected_files if not args_passed: @@ -330,7 +333,8 @@ def handle(self, *args, **options): fmt_str = f"ALL ({num_files})" if reparse_all else f"({num_files})" continue_msg += "\nThese options will delete and reparse {0} datafiles.".format(fmt_str) - self._handle_input(testing, continue_msg) + if not selected_files: + self._handle_input(testing, continue_msg) system_user, created = User.objects.get_or_create(username='system') if created: