Hack to handle empty country_lookup

This commit is contained in:
PCoder 2021-11-22 19:57:59 +05:30
parent 8cef9e4bef
commit ab551cfb6c

View file

@ -412,6 +412,8 @@ def handle_object_dict(object_dict, model_name):
object_dict['status'] = PeopleStatus.objects.get(id=int(object_dict['status'])) object_dict['status'] = PeopleStatus.objects.get(id=int(object_dict['status']))
if 'country_lookup' in object_dict: if 'country_lookup' in object_dict:
print('Getting country of %s' % object_dict['country_lookup']) print('Getting country of %s' % object_dict['country_lookup'])
if object_dict['country_lookup'] == '':
object_dict['country_lookup'] = 0
object_dict['country'] = Country.objects.get(id=int(object_dict['country_lookup'])) object_dict['country'] = Country.objects.get(id=int(object_dict['country_lookup']))
object_dict.pop('country_lookup') object_dict.pop('country_lookup')
for i in ['news_letter', 'birds', 'mammals', 'reptiles', 'amphibians', 'fish', 'insects', for i in ['news_letter', 'birds', 'mammals', 'reptiles', 'amphibians', 'fish', 'insects',