Skip to content
Browse files

WHISTLE-42: remove the adding of service plans, create_account works …

…again
  • Loading branch information...
1 parent 56d2290 commit abaf50038728683607fd431551e5229a839293ec @jamesaimonetti jamesaimonetti committed Sep 10, 2012
Showing with 2 additions and 17 deletions.
  1. +2 −17 whistle_apps/apps/crossbar/src/crossbar_maintenance.erl
View
19 whistle_apps/apps/crossbar/src/crossbar_maintenance.erl
@@ -399,24 +399,9 @@ validate_user(JObj, Context) ->
{'error', wh_json:json_object()}.
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 ->
+ #cb_context{resp_status=success, db_name=AccountDb, account_id=AccountId}=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),

0 comments on commit abaf500

Please sign in to comment.
Something went wrong with that request. Please try again.