Alert admin if dispute created for unregistered domain

This commit is contained in:
Karl Erik Õunapuu 2020-05-19 10:54:29 +03:00
parent 36f5ec734e
commit cb0051d4e0
2 changed files with 27 additions and 9 deletions

View file

@ -27,7 +27,10 @@ module Admin
def create
@dispute = Dispute.new(dispute_params)
if @dispute.save
redirect_to admin_disputes_url, notice: 'Dispute was successfully created.'
notice = 'Dispute was successfully created'
notice += @dispute.domain ? '.' : ' for domain that is not registered.'
redirect_to admin_disputes_url, notice: notice
else
render :new
end