0
0
Fork 0

Fix changing domain block severity not undoing individual account effects (#22135)

* Fix changing domain block severity not undoing individual account effects

Fixes #22133

* Add tests
This commit is contained in:
Claire 2022-12-15 17:45:02 +01:00 committed by GitHub
parent 1e49be3328
commit 8556a649d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 98 additions and 10 deletions

View file

@ -55,12 +55,8 @@ module Admin
def update
authorize :domain_block, :update?
@domain_block.update(update_params)
severity_changed = @domain_block.severity_changed?
if @domain_block.save
DomainBlockWorker.perform_async(@domain_block.id, severity_changed)
if @domain_block.update(update_params)
DomainBlockWorker.perform_async(@domain_block.id, @domain_block.severity_previously_changed?)
log_action :update, @domain_block
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
else