Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[importer] disable check on country attribute in incident model #827

Open
tlongers opened this issue Nov 24, 2023 · 1 comment
Open

[importer] disable check on country attribute in incident model #827

tlongers opened this issue Nov 24, 2023 · 1 comment

Comments

@tlongers
Copy link
Member

Where a value in incident:location has no match in the locations dataset, the importer reports two errors:

  • the location doesn't exist; and,
  • the country code is missing.

Code:

try:
exact_location = Location.objects.from_humane_id(humane_id)
except Location.DoesNotExist:
self.log_error('Location {} for ViolationLocation does not exist'.format(humane_id))
self.log_error('Country code missing')
return None

The data sheet does not contain an incident:country attribute to check, so the report is misleading. Unless it does something else that I can't see, I suggest removing this check.

@hancush
Copy link

hancush commented Dec 4, 2023

Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants