Commit 94bf3c4f authored by Okhin's avatar Okhin
Browse files

Let's add a filter for Multiple Constituency because nationalist have alack of imagination.

parent 1ce7d64d
Pipeline #1085 passed with stage
in 10 minutes and 31 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