Fix accessing wrong key

This commit is contained in:
PCoder 2021-11-22 19:56:09 +05:30
parent 18eb13591a
commit 8cef9e4bef
1 changed files with 2 additions and 1 deletions

View File

@ -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',