Added a list of valid columns when a wrong column is specified
- Inspired on rdeterre/kiplot@6a9d8e3
This commit is contained in:
parent
a3811537b8
commit
6941202d2a
|
|
@ -572,7 +572,8 @@ class BoMOptions(BaseOptions):
|
|||
if new_col_l not in valid_columns_l:
|
||||
# The Field_Rename filter can change this situation:
|
||||
# raise KiPlotConfigurationError('Invalid column name `{}`'.format(new_col))
|
||||
logger.warning(W_BADFIELD+'Invalid column name `{}`'.format(new_col))
|
||||
logger.warning(W_BADFIELD+'Invalid column name `{}`. Valid columns are {}.'.
|
||||
format(new_col, list(valid_columns_l.values())))
|
||||
columns.append(new_col)
|
||||
column_levels.append(level)
|
||||
column_comments.append(comment)
|
||||
|
|
|
|||
|
|
@ -267,7 +267,9 @@ class KiBoMConfig(Optionable):
|
|||
self.join.append(col.field+'\t'+col.join)
|
||||
# Check this is a valid column
|
||||
if new_col.lower() not in valid_columns_l:
|
||||
raise KiPlotConfigurationError('Invalid column name `{}`'.format(new_col))
|
||||
# Should we relax it? (as in out_bom)
|
||||
raise KiPlotConfigurationError('Invalid column name `{}`. Valid columns are {}.'.
|
||||
format(new_col, list(valid_columns_l.values())))
|
||||
columns.append(new_col)
|
||||
columns_l[new_col.lower()] = new_col
|
||||
# Create a list of the columns we don't want
|
||||
|
|
|
|||
Loading…
Reference in New Issue