summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/couchdb/couch_rep.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl
index 1a894523..e7833d15 100644
--- a/src/couchdb/couch_rep.erl
+++ b/src/couchdb/couch_rep.erl
@@ -462,9 +462,10 @@ open_db(<<"http://",_/binary>>=Url, _, CreateTarget) ->
open_db(<<"https://",_/binary>>=Url, _, CreateTarget) ->
open_db({[{<<"url">>,Url}]}, [], CreateTarget);
open_db(<<DbName/binary>>, UserCtx, CreateTarget) ->
- ok = couch_httpd:verify_is_server_admin(UserCtx),
case CreateTarget of
- true -> couch_server:create(DbName, [{user_ctx, UserCtx}]);
+ true ->
+ ok = couch_httpd:verify_is_server_admin(UserCtx),
+ couch_server:create(DbName, [{user_ctx, UserCtx}]);
false -> ok
end,