realm/playground: Add API endpoint for deleting a playground entry.

Similar to the previous commit, we have added a `do_*` function
which does the deletion from the DB. The next commit handles sending
the events when both adding and deleting a playground entry.

Added the openAPI format data to zulip.yaml for DELETE
/realm/playgrounds/{playground_id}. Also added python and curl
examples to remove-playground.md.

Tests added.
This commit is contained in:
Sumanth V Rao
2020-10-27 06:51:22 +05:30
parent 251b415987
commit d2e5b62dce
9 changed files with 129 additions and 3 deletions

View File

@@ -6602,6 +6602,10 @@ def do_add_realm_playground(realm: Realm, **kwargs: Any) -> int:
return realm_playground.id
def do_remove_realm_playground(realm_playground: RealmPlayground) -> None:
realm_playground.delete()
def get_occupied_streams(realm: Realm) -> QuerySet:
# TODO: Make a generic stub for QuerySet
""" Get streams with subscribers """