mirror of https://github.com/zulip/zulip.git
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:
parent
3c464d9d63
commit
205657b3cf
|
@ -2288,10 +2288,8 @@ paths:
|
||||||
- $ref: '#/components/schemas/JsonSuccess'
|
- $ref: '#/components/schemas/JsonSuccess'
|
||||||
- example:
|
- example:
|
||||||
{
|
{
|
||||||
"description": "Description successfully updated.",
|
|
||||||
"result": "success",
|
"result": "success",
|
||||||
"msg": "",
|
"msg": ""
|
||||||
"name": "Name successfully updated."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
'400':
|
'400':
|
||||||
|
|
|
@ -152,8 +152,6 @@ class UserGroupAPITestCase(ZulipTestCase):
|
||||||
}
|
}
|
||||||
result = self.client_patch('/json/user_groups/{}'.format(user_group.id), info=params)
|
result = self.client_patch('/json/user_groups/{}'.format(user_group.id), info=params)
|
||||||
self.assert_json_success(result)
|
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.
|
# Test when new data is not supplied.
|
||||||
result = self.client_patch('/json/user_groups/{}'.format(user_group.id), info={})
|
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)
|
result = self.client_patch('/json/user_groups/{}'.format(user_group.id), info=params)
|
||||||
self.assert_json_success(result)
|
self.assert_json_success(result)
|
||||||
self.assertEqual(result.json()['description'], 'Description successfully updated.')
|
|
||||||
|
|
||||||
def test_user_group_update_by_guest_user(self) -> None:
|
def test_user_group_update_by_guest_user(self) -> None:
|
||||||
hamlet = self.example_user('hamlet')
|
hamlet = self.example_user('hamlet')
|
||||||
|
|
|
@ -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)
|
user_group = access_user_group_by_id(user_group_id, user_profile)
|
||||||
|
|
||||||
result = {}
|
|
||||||
if name != user_group.name:
|
if name != user_group.name:
|
||||||
do_update_user_group_name(user_group, name)
|
do_update_user_group_name(user_group, name)
|
||||||
result['name'] = _("Name successfully updated.")
|
|
||||||
|
|
||||||
if description != user_group.description:
|
if description != user_group.description:
|
||||||
do_update_user_group_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
|
@require_member_or_admin
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
|
|
Loading…
Reference in New Issue