playgrounds: Avoid json encoding each field in POST /realm/playgrounds.

This prevents us from having to json encode every field in the POST
request to /realm/playgrounds, and keeps the client logic simpler
when adding a playground.
This commit is contained in:
Sumanth V Rao
2021-04-17 11:56:57 +05:30
committed by Tim Abbott
parent 3b974d9ef7
commit f9b79999ed
5 changed files with 16 additions and 26 deletions

View File

@@ -390,8 +390,8 @@ def add_realm_playground(client: Client) -> None:
# Add a realm playground for Python
request = {
"name": "Python playground",
"pygments_language": json.dumps("Python"),
"url_prefix": json.dumps("https://python.example.com"),
"pygments_language": "Python",
"url_prefix": "https://python.example.com",
}
result = client.call_endpoint(url="/realm/playgrounds", method="POST", request=request)
# {code_example|end}