Skip to content
Snippets Groups Projects
Commit ddf3a820 authored by Diana Huang's avatar Diana Huang
Browse files

Remove items from a different dictionary than the one we're

iterating over.
parent 35c2d766
Branches
Tags
No related merge requests found
......@@ -104,9 +104,11 @@ class BlockSerializer(serializers.Serializer): # pylint: disable=abstract-metho
if authorization_denial_reason and authorization_denial_message:
data['authorization_denial_reason'] = authorization_denial_reason
data['authorization_denial_message'] = authorization_denial_message
cleaned_data = data.copy()
for field in data.keys(): # pylint: disable=consider-iterating-dictionary
if field not in FIELDS_ALLOWED_IN_AUTH_DENIED_CONTENT:
del data[field]
del cleaned_data[field]
data = cleaned_data
return data
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment