mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Skip status when value blank
This commit is contained in:
parent
8d4a4c437b
commit
075cdc0f0d
2 changed files with 18 additions and 1 deletions
|
@ -19,6 +19,7 @@ class Admin::DomainsController < ApplicationController
|
|||
flash[:notice] = I18n.t('shared.domain_added')
|
||||
redirect_to [:admin, @domain]
|
||||
else
|
||||
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||
flash.now[:alert] = I18n.t('shared.failed_to_add_domain')
|
||||
render 'new'
|
||||
end
|
||||
|
@ -34,6 +35,8 @@ class Admin::DomainsController < ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||
|
||||
params[:registrar] = @domain.registrar
|
||||
params[:domain_owner_contact] = @domain.owner_contact
|
||||
end
|
||||
|
@ -42,6 +45,7 @@ class Admin::DomainsController < ApplicationController
|
|||
if @domain.update(domain_params)
|
||||
redirect_to [:admin, @domain]
|
||||
else
|
||||
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||
render 'edit'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue