From 9e0a3cbd64cb0773224be1f7c02eef170e7b2a57 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 Sep 2021 11:42:34 +0300 Subject: [PATCH] Fix MultiValueDictKeyError issue --- graphene_file_upload/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphene_file_upload/utils.py b/graphene_file_upload/utils.py index 98454d9..dc121ba 100644 --- a/graphene_file_upload/utils.py +++ b/graphene_file_upload/utils.py @@ -19,8 +19,9 @@ def place_files_in_operations(operations, files_map, files): # output to be operations itself output = operations for path, key in path_to_key_iter: - file_obj = files[key] - output = add_file_to_operations(output, file_obj, path) + file_obj = files.get(key, None) + if file_obj: + output = add_file_to_operations(output, file_obj, path) return output