Hack to handle empty status

This commit is contained in:
PCoder 2021-11-22 19:58:48 +05:30
parent ab551cfb6c
commit 47ba92a8d1
1 changed files with 2 additions and 0 deletions

View File

@ -409,6 +409,8 @@ def handle_object_dict(object_dict, model_name):
object_dict['organization_id'] = int(float(object_dict['organization_id']))
if 'status' in object_dict:
print('Getting status of %s' % object_dict['status'])
if object_dict['status'] == '':
object_dict['status'] = 0
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_lookup'])