From 323b1cb8ec6523801b3fe7aad30c74adfe7a800c Mon Sep 17 00:00:00 2001 From: PiTrem Date: Mon, 30 Sep 2024 22:37:20 +0200 Subject: [PATCH] fix: admin restore account - rm obsolete has_profile calls(#2181) from admin_user api and page controllers. (method was removed in 2d7ed9a3a #2001 ) --- app/api/chemotion/admin_user_api.rb | 4 ---- app/controllers/pages_controller.rb | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/api/chemotion/admin_user_api.rb b/app/api/chemotion/admin_user_api.rb index d8c9790a80..560e96d699 100644 --- a/app/api/chemotion/admin_user_api.rb +++ b/app/api/chemotion/admin_user_api.rb @@ -61,14 +61,10 @@ class AdminUserAPI < Grape::API # rubocop:disable Rails/SkipsModelValidations elsif existing_user.nil? deleted_user.update_columns(deleted_at: nil, name_abbreviation: params[:name_abbreviation]) - # create a default user profile - deleted_user.has_profile { status: 'success', message: 'Account successfully restored' } elsif existing_user.present? deleted_user.update_columns(deleted_at: nil, account_active: false) - # create a default user profile - deleted_user.has_profile { status: 'warning', message: 'Account restored. Warning: Abbreviation already exists! Please update the Abbr and Email' } end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index d0e2de1cf5..07042a3d48 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -47,8 +47,7 @@ def update_user end def profiles - current_user.has_profile - @profile = current_user.profile + @profile = current_user&.profile end def update_profiles