Skip to content

Commit

Permalink
pr-powerpbx_master: fix service plan not loading when no overrides pr…
Browse files Browse the repository at this point in the history
…esent (2600hz#3971)
  • Loading branch information
fenollp authored and lazedo committed Jul 20, 2017
1 parent 460c4bd commit fbb92d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/kazoo_services/src/kz_service_plans.erl
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ get_plan(PlanId, ResellerId, Services, ServicePlans) ->
-spec maybe_fetch_vendor_plan(ne_binary(), ne_binary(), ne_binary(), kz_json:object()) ->
api_object().
maybe_fetch_vendor_plan(PlanId, VendorId, VendorId, Overrides) ->
AreOverridesEmpty = kz_json:is_empty(Overrides),
case kz_service_plan:fetch(PlanId, VendorId) of
'undefined' -> 'undefined';
ServicePlan ->
kzd_service_plan:merge_overrides(ServicePlan, Overrides)
ServicePlan when not AreOverridesEmpty ->
kzd_service_plan:merge_overrides(ServicePlan, Overrides);
ServicePlan -> ServicePlan
end;
maybe_fetch_vendor_plan(PlanId, _, ResellerId, _) ->
lager:debug("service plan ~s doesnt belong to reseller ~s", [PlanId, ResellerId]),
Expand Down

0 comments on commit fbb92d6

Please sign in to comment.