Skip to content

Commit

Permalink
Rename strip function.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeiklejohn committed Dec 4, 2012
1 parent 854853b commit a4dd897
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/riak_cs_control_helpers.erl
Expand Up @@ -14,11 +14,11 @@

-export([configure_s3_connection/0,
administration_bucket_name/0,
reencode_attributes/1,
strip_root_from_attributes/1,
iso8601/1,
admin_key/0]).

reencode_attributes(Attributes) ->
strip_root_from_attributes(Attributes) ->
{struct, [{<<"user">>, DecodedAttributes}]} = mochijson2:decode(Attributes),
mochijson2:encode(DecodedAttributes).

Expand Down
2 changes: 1 addition & 1 deletion src/riak_cs_control_wm_user.erl
Expand Up @@ -83,7 +83,7 @@ from_json(ReqData, Context) ->
{true, NewContext} ->
try
Attributes = wrq:req_body(ReqData),
NewAttributes = riak_cs_control_helpers:reencode_attributes(Attributes),
NewAttributes = riak_cs_control_helpers:strip_root_from_attributes(Attributes),
{ok, _Response} = riak_cs_control_session:put_user(KeyId, NewAttributes),
Resource = "/users/" ++ KeyId,
NewReqData = wrq:set_resp_header("Location", Resource, ReqData),
Expand Down
2 changes: 1 addition & 1 deletion src/riak_cs_control_wm_users.erl
Expand Up @@ -95,7 +95,7 @@ maybe_create_user(ReqData, Context) ->
undefined ->
try
Attributes = wrq:req_body(ReqData),
NewAttributes = riak_cs_control_helpers:reencode_attributes(Attributes),
NewAttributes = riak_cs_control_helpers:strip_root_from_attributes(Attributes),
{ok, {_Headers, Body}} = riak_cs_control_session:put_user(NewAttributes),
ParsedResponse = mochijson2:decode(Body),
{true, Context#context{user=ParsedResponse}}
Expand Down

0 comments on commit a4dd897

Please sign in to comment.