settings: Change error for "no data" to something more friendly.

This commit is contained in:
Brock Whittaker 2018-01-11 11:28:44 -08:00 committed by Steve Howell
parent ffe3a6c127
commit 849d63dd1c
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ class ChangeSettingsTest(ZulipTestCase):
self.login(self.example_email("hamlet"))
result = self.client_patch("/json/settings",
dict(old_password='ignored',))
self.assert_json_error(result, "No new data supplied")
self.assert_json_error(result, "Please fill out all fields.")
def do_test_change_user_display_setting(self, setting_name: str) -> None:

View File

@ -75,7 +75,7 @@ def json_change_settings(request: HttpRequest, user_profile: UserProfile,
old_password: Text=REQ(default=""),
new_password: Text=REQ(default="")) -> HttpResponse:
if not (full_name or new_password or email):
return json_error(_("No new data supplied"))
return json_error(_("Please fill out all fields."))
if new_password != "":
if not authenticate(username=user_profile.email, password=old_password,