Set MountainRange area to -1 explicitly if not set

This commit is contained in:
PCoder 2021-11-29 09:36:40 +05:30
parent ec40e896b3
commit 0d3bbb3154

View file

@ -449,6 +449,10 @@ def handle_object_dict(object_dict, model_name, debug=False):
for i in ['checked']: for i in ['checked']:
if i in object_dict: if i in object_dict:
object_dict[i] = True if object_dict[i].lower().strip() == 'true' else False object_dict[i] = True if object_dict[i].lower().strip() == 'true' else False
# area field can't be empty
if 'area' in object_dict:
if object_dict['area'] == '':
object_dict['area'] = -1
if model_name == 'Keyword': if model_name == 'Keyword':
object_dict['keyword'] = object_dict['keyword_id'] object_dict['keyword'] = object_dict['keyword_id']
object_dict.pop('keyword_id') object_dict.pop('keyword_id')