Skip to content
Snippets Groups Projects
Unverified Commit d3ef4304 authored by Kyle McCormick's avatar Kyle McCormick Committed by GitHub
Browse files

Fix KeyError in v2 Libraries API (#25753)

parent 56a5405d
No related branches found
No related tags found
No related merge requests found
......@@ -158,10 +158,11 @@ class LibraryRootView(APIView):
# definitions elsewhere.
data['library_type'] = data.pop('type')
data['library_license'] = data.pop('license')
key_data = data.pop("key")
# Move "slug" out of the "key.slug" pseudo-field that the serializer added:
data["slug"] = data.pop("key")["slug"]
data["slug"] = key_data["slug"]
# Get the organization short_name out of the "key.org" pseudo-field that the serializer added:
org_name = data["key"]["org"]
org_name = key_data["org"]
try:
ensure_organization(org_name)
except InvalidOrganizationException:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment