From: Karl O. Pinc Date: Mon, 18 Jan 2021 21:28:46 +0000 (-0600) Subject: Force "caution: prior errors" when errors in mutiple files X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=c4426e105ac335d22ae69c858ec57a96857021bd;p=pgwui_bulk_upload Force "caution: prior errors" when errors in mutiple files --- 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