Browse files

v1.56: master account will never have a service plan on it, so just c…

…atch the crash and move on with life.
  • Loading branch information...
1 parent aad44c1 commit 8273f6d18bde20fa8ed2be1b3a2d6f2d324d007a @jamesaimonetti jamesaimonetti committed Jul 9, 2012
View
17 whistle_apps/apps/crossbar/src/crossbar_maintenance.erl
@@ -397,22 +397,7 @@ create_account(Context) ->
case crossbar_bindings:fold(<<"v1_resource.execute.put.accounts">>, [Context]) of
#cb_context{resp_status=success, db_name=AccountDb, account_id=AccountId, doc=Doc}=Context1 ->
io:format("created new account '~s' in db '~s'~n", [AccountId, AccountDb]),
-
- case wh_json:get_value(<<"service_plan">>, Doc) of
- undefined ->
- lager:debug("no service plan configured (perhaps this was the first system account?"),
- Doc1 = cb_accounts:add_pvt_service_plan(Doc),
- case couch_mgr:save_doc(AccountDb, Doc1) of
- {ok, Doc2} ->
- lager:debug("set service plan"),
- {ok, Context1#cb_context{doc=Doc2}};
- {error, _E} ->
- lager:debug("failed to set service plan: ~p", [_E]),
- {ok, Context1}
- end;
- _ ->
- {ok, Context1}
- end;
+ {ok, Context1};
#cb_context{resp_data=Errors} ->
io:format("failed to create account: '~s'~n", [list_to_binary(wh_json:encode(Errors))]),
AccountId = wh_json:get_value(<<"_id">>, Context#cb_context.req_data),
View
1 whistle_apps/apps/crossbar/src/modules/cb_accounts.erl
@@ -23,7 +23,6 @@
-export([create_account/1
,get_realm_from_db/1
,ensure_parent_set/0
- ,add_pvt_service_plan/2
]).
-include_lib("crossbar/include/crossbar.hrl").

0 comments on commit 8273f6d

Please sign in to comment.