api: Remove spammy json_success content for edit_user_group.

These values were unnecessary translated strings not displayed
anywhere, and were not consistent with Zulip's API standards.
This commit is contained in:
sameerchoubey 2019-07-07 00:34:02 +05:30 committed by Tim Abbott
parent 3c464d9d63
commit 205657b3cf
3 changed files with 2 additions and 10 deletions

View File

@ -2288,10 +2288,8 @@ paths:
- $ref: '#/components/schemas/JsonSuccess'
- example:
{
"description": "Description successfully updated.",
"result": "success",
"msg": "",
"name": "Name successfully updated."
"msg": ""
}
'400':

View File

@ -152,8 +152,6 @@ class UserGroupAPITestCase(ZulipTestCase):
}
result = self.client_patch('/json/user_groups/{}'.format(user_group.id), info=params)
self.assert_json_success(result)
self.assertEqual(result.json()['name'], 'Name successfully updated.')
self.assertEqual(result.json()['description'], 'Description successfully updated.')
# Test when new data is not supplied.
result = self.client_patch('/json/user_groups/{}'.format(user_group.id), info={})
@ -185,7 +183,6 @@ class UserGroupAPITestCase(ZulipTestCase):
}
result = self.client_patch('/json/user_groups/{}'.format(user_group.id), info=params)
self.assert_json_success(result)
self.assertEqual(result.json()['description'], 'Description successfully updated.')
def test_user_group_update_by_guest_user(self) -> None:
hamlet = self.example_user('hamlet')

View File

@ -44,16 +44,13 @@ def edit_user_group(request: HttpRequest, user_profile: UserProfile,
user_group = access_user_group_by_id(user_group_id, user_profile)
result = {}
if name != user_group.name:
do_update_user_group_name(user_group, name)
result['name'] = _("Name successfully updated.")
if description != user_group.description:
do_update_user_group_description(user_group, description)
result['description'] = _("Description successfully updated.")
return json_success(result)
return json_success()
@require_member_or_admin
@has_request_variables