From 052935e8daf7e74718c8d6287e13b69710638463 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Mon, 4 Mar 2019 11:30:41 +0100 Subject: [PATCH] TT#53760 Fix using of the explicit copy mode flag Change-Id: I9e77a8ccfbd3e17a959c0cb5faeca1e5afd8888f --- lib/NGCP/Panel/Form/EmailTemplate/Reseller.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/NGCP/Panel/Form/EmailTemplate/Reseller.pm b/lib/NGCP/Panel/Form/EmailTemplate/Reseller.pm index 2d9c50426e..a6a9e9494c 100644 --- a/lib/NGCP/Panel/Form/EmailTemplate/Reseller.pm +++ b/lib/NGCP/Panel/Form/EmailTemplate/Reseller.pm @@ -47,7 +47,7 @@ Please go to [% url %] to set your password and log into your self-care interfac Your faithful Sipwise system --- +-- This is an automatically generated message. Do not reply. EOS_DEFAULT_TEXT ); @@ -100,12 +100,15 @@ sub validate { name => $name, reseller_id => $reseller_id, }); - my $current_item = $self->item ? $self->item : $c->stash->{tmpl}; - my $current_item_id = - $current_item && $c->stash->{is_copy} - ? ref $current_item eq 'HASH' - ? $current_item->{id} : $current_item->id - : undef; + my $current_item_id; + if (!$c->stash->{is_copy}) { + my $current_item = $self->item ? $self->item : $c->stash->{tmpl}; + $current_item_id = + $current_item + ? ref $current_item eq 'HASH' + ? $current_item->{id} : $current_item->id + : undef; + } if ($existing_item && (!$current_item_id || $existing_item->id != $current_item_id)) { $self->field('name')->add_error($c->loc('This name already exists')); }