Commit 44f01b6a authored by okhin's avatar okhin 🚴
Browse files

Merge branch '185-import-process-crashes-with-to-bogus-json-entry' into 'master'

Resolve "Import process crashes with to "bogus" json entry"

Closes #185

See merge request !209
parents 1ce7d64d 94bf3c4f
Pipeline #1086 passed with stages
in 10 minutes and 36 seconds
......@@ -301,6 +301,11 @@ class ParltrackImporter(GenericImporter):
except Constituency.DoesNotExist:
constituency = Constituency(name=local_party)
save_constituency = True
except Constituency.MultipleObjectsReturned:
# There is more than one constituency with that name.
# We must filter them by country.
constituency = Constituency.objects.get(name=local_party,
if constituency.country_id != country_id:
constituency.country_id = country_id
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment