diff --git a/app/management/commands/import.py b/app/management/commands/import.py index 7a98732..b55d797 100644 --- a/app/management/commands/import.py +++ b/app/management/commands/import.py @@ -457,6 +457,12 @@ def handle_object_dict(object_dict, model_name, debug=False): if model_name == 'Keyword': object_dict['keyword'] = object_dict['keyword_id'] object_dict.pop('keyword_id') + if object_dict['keyword'] == '': + object_dict['keyword'] = 0 + try: + object_dict['keyword'] = Keyword.objects.get(id=0) # default Keyword which exists already + except Keyword.DoesNotExist as dne: + print(str(dne)) if model_name == 'Organization' and 'country_id' in object_dict: object_dict['country'] = object_dict['country_id'] object_dict.pop('country_id')