From c4426e105ac335d22ae69c858ec57a96857021bd Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Mon, 18 Jan 2021 15:28:46 -0600 Subject: [PATCH] Force "caution: prior errors" when errors in mutiple files --- src/pgwui_bulk_upload/templates/bulk_upload.mak | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pgwui_bulk_upload/templates/bulk_upload.mak b/src/pgwui_bulk_upload/templates/bulk_upload.mak index 220cbf7..f2cb46d 100644 --- a/src/pgwui_bulk_upload/templates/bulk_upload.mak +++ b/src/pgwui_bulk_upload/templates/bulk_upload.mak @@ -65,7 +65,7 @@ % endfor -<%def name="file_errors(errors, filepath)"> +<%def name="file_errors(errors, filepath, firsterr)"> % if filepath is not None: <% file_info = statmap[filepath] @@ -78,7 +78,7 @@ %> % endif <% - self.error_items(errors, sepclass='lightsep') + self.error_items(errors, sepclass='lightsep', caution=(not firsterr)) %> @@ -88,17 +88,19 @@
<% # Either every error has a filepath or none do + firsterr = True last_filepath = None f_errors = [] for error in errors: if isinstance(error, core_ex.UploadError): if error.filepath != last_filepath: if last_filepath: - self.file_errors(f_errors, last_filepath) + self.file_errors(f_errors, last_filepath, firsterr) + firsterr = False last_filepath = error.filepath f_errors = [] f_errors.append(error) - self.file_errors(f_errors, last_filepath) + self.file_errors(f_errors, last_filepath, firsterr) %> % endif -- 2.34.1