Rearrange if clause

This commit is contained in:
PCoder 2021-12-01 13:37:54 +05:30
parent b3ac3f9836
commit 8d6c76d072

View file

@ -490,10 +490,10 @@ def handle_object_dict(object_dict, model_name, debug=False):
object_dict['status'] = 0
object_dict['status'] = PeopleStatus.objects.get(id=int(object_dict['status']))
if 'country_lookup' in object_dict:
if debug:
print('Getting country of %s' % object_dict['country_lookup'])
if object_dict['country_lookup'].strip() == '' or object_dict['country_lookup'] is None:
object_dict['country_lookup'] = 0
if debug:
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',