Skip to content
Snippets Groups Projects
Unverified Commit d3517b07 authored by Feanil Patel's avatar Feanil Patel Committed by GitHub
Browse files

Merge pull request #22522 from edx/diana/py3-cleaned-data

Remove items from a different dictionary than the one we're iterating over.
parents 6cb441b8 ddf3a820
Branches
Tags release-2021-09-02-04.58
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