From 797504ef035b9b60de41fbc4bd05319863ebc89e Mon Sep 17 00:00:00 2001 From: PavelBegunkov <asml.silence@gmail.com> Date: Tue, 26 Jul 2016 13:51:40 +0300 Subject: [PATCH] Invalid popups after changing the profile information --- media/js/profileSettings.js | 6 +++--- .../application/classes/Controller/Handler/Settings.php | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/media/js/profileSettings.js b/media/js/profileSettings.js index d197767ac..12ac8ed15 100644 --- a/media/js/profileSettings.js +++ b/media/js/profileSettings.js @@ -30,7 +30,7 @@ $(function () { 'jobPositionID': $jobs.find('option:selected').val(), 'departmentID': $departments.find('option:selected').val(), }).always(_ => $submitButton.turnOn()) - .done(Popup.success('Профиль успешно изменён!')) - .fail(Popup.error('Произошла ошибка')) + .done(() => Popup.success('Профиль успешно изменён!')) + .fail(() => Popup.error('Произошла ошибка')) }); -}); \ No newline at end of file +}); diff --git a/~dev_rating/application/classes/Controller/Handler/Settings.php b/~dev_rating/application/classes/Controller/Handler/Settings.php index 8ecd09275..e3d820673 100644 --- a/~dev_rating/application/classes/Controller/Handler/Settings.php +++ b/~dev_rating/application/classes/Controller/Handler/Settings.php @@ -70,6 +70,8 @@ class Controller_Handler_Settings extends Controller_Handler if ($this->post->check()) User::instance()->changeProfile($this->post->data()); + else + throw HTTP_Exception::factory(400, 'Invalid parameters'); } public function action_getDepartmentsList() { -- GitLab