TT#43351 Keep high priority of current profile_set for subadmin

Change-Id: I1f802212d22b023288381b719763c668166035db
changes/24/23724/1
Irina Peshinskaya 8 years ago
parent b1e4733d00
commit cfa7cb4408

@ -26,7 +26,7 @@ has_block 'fields' => (
render_list => [qw/domain group_select alias_select pbx_extension display_name email webusername webpassword username password administrative lock status external_id timezone profile_set profile/ ],
);
override 'field_list' => sub {
override 'update_fields' => sub {
my $self = shift;
my $c = $self->ctx;
return unless $c;

@ -518,11 +518,11 @@ sub check_profile_set_and_profile {
# => subscriberadmin can't manage profile_set via web ui and API
#here we will provide profile_set so below we can check profile id
#please note, that we don't allow to subscriberadmin unset profile_set_id and profile_set at all, . Later we will take default profile for profile_set
if ($c->stash->{pilot} && $c->stash->{pilot}->provisioning_voip_subscriber->voip_subscriber_profile_set) {
$profile_set = $c->stash->{pilot}->provisioning_voip_subscriber->voip_subscriber_profile_set;
} elsif ($prov_subscriber && $resource->{profile}{id}) { #edit
if ($prov_subscriber && $resource->{profile}{id}) { #edit, preserve current profile_set
#not pbx account or pilot doesn't have any profile set
$profile_set = $prov_subscriber->voip_subscriber_profile_set;
} elsif ($c->stash->{pilot} && $c->stash->{pilot}->provisioning_voip_subscriber->voip_subscriber_profile_set) {
$profile_set = $c->stash->{pilot}->provisioning_voip_subscriber->voip_subscriber_profile_set;
}
}
}

Loading…
Cancel
Save