Strip and check with empty
This commit is contained in:
parent
9871e4ff17
commit
b3ac3f9836
|
@ -492,7 +492,7 @@ def handle_object_dict(object_dict, model_name, debug=False):
|
|||
if 'country_lookup' in object_dict:
|
||||
if debug:
|
||||
print('Getting country of %s' % object_dict['country_lookup'])
|
||||
if object_dict['country_lookup'] == '':
|
||||
if object_dict['country_lookup'].strip() == '' or object_dict['country_lookup'] is None:
|
||||
object_dict['country_lookup'] = 0
|
||||
object_dict['country'] = Country.objects.get(id=int(object_dict['country_lookup']))
|
||||
object_dict.pop('country_lookup')
|
||||
|
|
Loading…
Reference in New Issue