Skip to content
Snippets Groups Projects

Change the NC_CC_DEP validation error handling

Merged Neda Moeini requested to merge enhancement/change-nc-cc-dep-validation into develop
2 files
+ 7
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -244,9 +244,11 @@ class CSVUploadForm(forms.Form):
dep = row.get(dep_field)
nominal_account_name = row.get(nominal_account_field)
if not cc and not dep and not nominal_account_name:
errors.append(
f"Row {index}: Missing values in '{cc_field}', '{dep_field}', and '{nominal_account_field}'.")
continue
if not cc or not dep or not nominal_account_name:
errors.append(f"Row {index}: Missing values in '{cc_field}', '{dep_field}', or "
f"'{nominal_account_field}'.")
continue
cc_type = cost_centre_map.get(cc)
Loading