Skip to content

Commit

Permalink
Reject import file if it contains braces (#4537)
Browse files Browse the repository at this point in the history
reject import file if it contains braces
  • Loading branch information
perryr16 authored Feb 19, 2024
1 parent 070d459 commit bcbec02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions seed/data_importer/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,9 @@ def _save_raw_data_create_tasks(file_pk, progress_key):
_log.debug(f'Error reading XLSX file: {str(e)}')
return progress_data.finish_with_error('Failed to parse XLSX file. Please review your import file - all headers should be present and non-numeric.')

if any('{' in header or '}' in header for header in parser.headers):
return progress_data.finish_with_error('Failed to import. Please review your import file - headers cannot contain braces: { }')

import_file.has_generated_headers = False
if hasattr(parser, 'has_generated_headers'):
import_file.has_generated_headers = parser.has_generated_headers
Expand Down

0 comments on commit bcbec02

Please sign in to comment.