Skip to content

Commit

Permalink
add note when displaying errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunlong Li committed Aug 28, 2024
1 parent 082f168 commit 3fa6cc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def process_excel(self, uploaded_file, org_id):
error_list = "\n".join(f"Error {i+1}. {error}. " for i, error in enumerate(all_errors))
# format the error list to be displayed in human readable format
formatted_errors = f"<pre style='white-space: pre-wrap;'>{error_list}</pre>"
raise ValueError(f"""The following errors were found:
raise ValueError(f"""<pre>The following errors were found. Note The row number starts from 0.</pre> :
{formatted_errors}""")

samples_data = prepare_samples_data(samples_df, authors_df, related_resources_df, funding_df, org_id)
Expand All @@ -104,7 +104,7 @@ def process_excel(self, uploaded_file, org_id):
return return_value

except Exception as e:
raise ValueError(f"Failed to read Excel file: {str(e)}")
raise ValueError(f"{str(e)}")

def get(self):
"""
Expand Down

0 comments on commit 3fa6cc0

Please sign in to comment.