Set default values for empty "priority" column in spreadsheets.
Added logic to assign a default value of 1 to empty "priority" fields in the spreadsheet service. Adjusted the router to correctly track columns explicitly marked as defaulted.
This commit is contained in:
@ -68,14 +68,16 @@ class SampleSpreadsheetImporter:
|
||||
Tracks corrections and defaults applied separately.
|
||||
"""
|
||||
default_applied = False
|
||||
|
||||
# If the value is None or empty string
|
||||
if value is None or (isinstance(value, str) and value.strip() == ""):
|
||||
if column_name == "directory":
|
||||
logger.warning("Directory value is empty. Assigning default value.")
|
||||
default_applied = True
|
||||
return "{sgPuck}/{sgPosition}", default_applied
|
||||
|
||||
elif column_name == "priority":
|
||||
logger.warning("Priority value is empty. Assigning default value.")
|
||||
default_applied = True
|
||||
return 1, default_applied
|
||||
return None, default_applied
|
||||
|
||||
# Clean up the value
|
||||
|
Reference in New Issue
Block a user