mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:39:53 +01:00
Disallow deletion of accounts when a data export is pending
This commit is contained in:
parent
2229b8e782
commit
d9f82c4985
2 changed files with 9 additions and 0 deletions
|
@ -8,6 +8,12 @@ class User::RegistrationsController < Devise::RegistrationsController
|
|||
end
|
||||
|
||||
def destroy
|
||||
if resource.export_processing
|
||||
flash[:error] = t(".export_pending")
|
||||
redirect_to edit_user_registration_path
|
||||
return
|
||||
end
|
||||
|
||||
Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)
|
||||
resource.destroy
|
||||
set_flash_message :notice, :destroyed if is_flashing_format?
|
||||
|
|
|
@ -197,3 +197,6 @@ en:
|
|||
create:
|
||||
info: "You have %{count} recovery codes remaining."
|
||||
error: :errors.invalid_otp
|
||||
registrations:
|
||||
destroy:
|
||||
export_pending: "You may not delete your account while account data is currently being exported."
|
||||
|
|
Loading…
Reference in a new issue