Skip to content

Commit

Permalink
fix: admin restore account - rm obsolete has_profile calls(#2181)
Browse files Browse the repository at this point in the history
from admin_user api  and page controllers.
(method was removed in 2d7ed9a #2001 )
  • Loading branch information
PiTrem authored Sep 30, 2024
1 parent 7a51dad commit 323b1cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions app/api/chemotion/admin_user_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 323b1cb

Please sign in to comment.