MT#61065 Fix 'cli' preference removal

In commit b51c0c9698 the possibility to change the 'cli'
preference by subscriber and subscriber_admin was added
(under certain limits).

On the other hand, the additiona of that part of code
broke the possibility to remove the preference using
the PATCH api. It is a very uncommon scenario though,
but it seems anyway used by some customer.
We may think to deprecate this possibility one day,
but till then we don't have to create regression
to customer.

Change-Id: Ie695b567929eb79b1ba63d3c5a31ae5ce7b559bd
(cherry picked from commit f9a328f83d)
mr12.5
Marco Capetta 8 months ago
parent c27388f218
commit d2ef595fac

@ -618,6 +618,12 @@ sub update_preferences {
&$err_code(HTTP_UNPROCESSABLE_ENTITY, $err_msg);
return;
}
} else {
unless (exists $resource->{$k}) {
my $rs = get_preference_rs($c, $TYPE_PREF_MAP->{$type}, $elem, $k);
last SWITCH unless $rs; # unknown resource, just ignore
$rs->delete;
}
}
last SWITCH;
};

Loading…
Cancel
Save