Insert a default mother range initially, which will be reimported in the second pass

This commit is contained in:
PCoder 2021-11-25 11:22:29 +05:30
parent 03f06957f8
commit 4e9980d5f5

View file

@ -402,7 +402,7 @@ def handle_object_dict(object_dict, model_name):
if object_dict['mother_range'] == '':
object_dict['mother_range'] = 0
try:
object_dict['mother_range'] = Range.objects.get(id=int(object_dict['mother_range'].strip('\'')))
object_dict['mother_range'] = Range.objects.get(id=0) # default Range which exists already
except Range.DoesNotExist as dne:
print(str(dne))
if model_name == 'Keyword':