Skip to content

parse_export_format calls undefined function, crashes on any CSV import #860

@shiwani42

Description

@shiwani42

Issue

What is the issue?

parse_export_format() in application/utils/spreadsheet_parsers.py calls validate_export_csv_rows() on line 206, but that function is never defined anywhere in the codebase. The only validation function that exists is validate_import_csv_rows() (line 136, same file).

This was introduced in commit 605bb6d during the CSV validation refactor (PR #682), where the function was defined under one name but called under another.

Expected Behaviour

Calling POST /rest/v1/cre_csv_import with a valid CSV file should run validation and import the data.

Actual Behaviour

Every call to parse_export_format() raises:

NameError: name 'validate_export_csv_rows' is not defined

The import endpoint is completely broken. The existing unit test test_parse_export_format also fails immediately for the same reason.

Steps to reproduce

POST /rest/v1/cre_csv_import

with any CSV file. The 500 is raised before any CSV content is inspected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions