Record revokers when deactivating blocks by editing

This commit is contained in:
Anton Khorev 2024-08-19 15:21:59 +03:00
parent 41b81bd393
commit 6c4b028232
2 changed files with 23 additions and 0 deletions

View file

@ -72,6 +72,7 @@ class UserBlocksController < ApplicationController
@user_block.reason = params[:user_block][:reason]
@user_block.needs_view = params[:user_block][:needs_view]
@user_block.ends_at = Time.now.utc + @block_period.hours
@user_block.revoker = current_user if user_block_was_active && !@user_block.active?
if !user_block_was_active && @user_block.active?
flash.now[:error] = t(".inactive_block_cannot_be_reactivated")
render :action => "edit"