We currently have two kinds of CSV importers in our codebase for importing IP addresses for a provider - one was a external contribution a few years back.
The two importers
There is the new style CSVImporter importer that follows the ImporterProtocol, so the importing logic is shared with the other ones that import the protocol.
This is in apps.greenchcheck.importers.importers_csv.CSVImporter, and is used in our admin UI.
There is also the older ImporterCSV class that was created before, and contains its own network importer logic, and only supports IP4 imports.
This is in apps.greencheck.bulk_importers.ImporterCSV
This is used in our management command, import_from_csv.
What I think we should do
This is a bit confusing, and really we should only have one.
Really, we ought to be only using the newer version, and removing the ImporterCSV, so all our CSV importing uses the same code path, and we have consistent signatures for creating instances of the class.
If there are any helpful exceptions to raise and display to end users, this would be the time to make those changes too, probably.
We currently have two kinds of CSV importers in our codebase for importing IP addresses for a provider - one was a external contribution a few years back.
The two importers
There is the new style
CSVImporterimporter that follows theImporterProtocol, so the importing logic is shared with the other ones that import the protocol.This is in
apps.greenchcheck.importers.importers_csv.CSVImporter, and is used in our admin UI.There is also the older
ImporterCSVclass that was created before, and contains its own network importer logic, and only supports IP4 imports.This is in
apps.greencheck.bulk_importers.ImporterCSVThis is used in our management command,
import_from_csv.What I think we should do
This is a bit confusing, and really we should only have one.
Really, we ought to be only using the newer version, and removing the ImporterCSV, so all our CSV importing uses the same code path, and we have consistent signatures for creating instances of the class.
If there are any helpful exceptions to raise and display to end users, this would be the time to make those changes too, probably.