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

@@ -5,7 +5,6 @@
# based on Zulip's OpenAPI definitions, as well as test setup and
# fetching of appropriate parameter values to use when running the
# cURL examples as part of the tools/test-api test suite.
import json
from functools import wraps
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
@@ -283,8 +282,8 @@ def upload_custom_emoji() -> Dict[str, object]:
def add_realm_playground() -> Dict[str, object]:
return {
"name": "Python2 playground",
"pygments_language": json.dumps("Python2"),
"url_prefix": json.dumps("https://python2.example.com"),
"pygments_language": "Python2",
"url_prefix": "https://python2.example.com",
}