Disallow deletion of accounts when a data export is pending
This commit is contained in:
parent
2229b8e782
commit
d9f82c4985
|
@ -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 New Issue