diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-25 17:46:28 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-25 17:46:28 +0300 |
commit | 7fe8d41d88f744b16e6e12c1c07ef3f956994110 (patch) | |
tree | 0efc2685d16b5d49a962d0a232099acdf3e35d70 /app/controllers/oauth/applications_controller.rb | |
parent | a61ccd4ad2d83b2422561a374c300260e5a6d240 (diff) |
Improve code style
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/oauth/applications_controller.rb')
-rw-r--r-- | app/controllers/oauth/applications_controller.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb index 8eafe5e3b3d..b53e9662af0 100644 --- a/app/controllers/oauth/applications_controller.rb +++ b/app/controllers/oauth/applications_controller.rb @@ -8,7 +8,11 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController def create @application = Doorkeeper::Application.new(application_params) - @application.owner = current_user if Doorkeeper.configuration.confirm_application_owner? + + if Doorkeeper.configuration.confirm_application_owner? + @application.owner = current_user + end + if @application.save flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create]) redirect_to oauth_application_url(@application) @@ -18,8 +22,10 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController end def destroy - flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :destroy]) if @application.destroy + if @application.destroy + flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :destroy]) + end + redirect_to profile_account_url end - -end
\ No newline at end of file +end |