From 8cef9e4bef2184e2902e4ae257b3925121848b61 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 22 Nov 2021 19:56:09 +0530 Subject: [PATCH] Fix accessing wrong key --- app/management/commands/import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/management/commands/import.py b/app/management/commands/import.py index 2d21008..07fe724 100644 --- a/app/management/commands/import.py +++ b/app/management/commands/import.py @@ -411,8 +411,9 @@ def handle_object_dict(object_dict, model_name): print('Getting status of %s' % object_dict['status']) object_dict['status'] = PeopleStatus.objects.get(id=int(object_dict['status'])) if 'country_lookup' in object_dict: - print('Getting country of %s' % object_dict['country']) + print('Getting country of %s' % object_dict['country_lookup']) object_dict['country'] = Country.objects.get(id=int(object_dict['country_lookup'])) + object_dict.pop('country_lookup') for i in ['news_letter', 'birds', 'mammals', 'reptiles', 'amphibians', 'fish', 'insects', 'molluscs', 'crustaceans', 'arachnids', 'angiosperms', 'gymnosperms', 'fungi', 'algae', 'microbes', 'biological_field_sampling', 'data_mining', 'remote_sensing',