diff options
author | Paul Joseph Davis <davisp@apache.org> | 2009-10-19 14:49:50 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2009-10-19 14:49:50 +0000 |
commit | 7cda6c7c2d72053407da7d0caee73026bebab25b (patch) | |
tree | 0b8cc2dafbbe3c5e714ad64eb8aeb9464a0b1649 /src | |
parent | 430b75f7572d3033fe61e341d0ee5ff1167831e2 (diff) |
Fix bug when lists use two design docs.
The language was being pulled from the wrong doc in the pair. Also removed some
unused variables. Added a test in list_views.js
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@826692 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/couchdb/couch_httpd_show.erl | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/couchdb/couch_httpd_show.erl b/src/couchdb/couch_httpd_show.erl index 3aa6b566..a961033a 100644 --- a/src/couchdb/couch_httpd_show.erl +++ b/src/couchdb/couch_httpd_show.erl @@ -124,16 +124,14 @@ handle_view_list(Req, ListDesignName, ListName, ViewDesignName, ViewName, Db, Ke #doc{body={ListProps}} = couch_httpd_db:couch_doc_open(Db, ListDesignId, nil, []), if ViewDesignName == ListDesignName -> - ViewProps = ListProps, ViewDesignId = ListDesignId; true -> - ViewDesignId = <<"_design/", ViewDesignName/binary>>, - #doc{body={ViewProps}} = couch_httpd_db:couch_doc_open(Db, ViewDesignId, nil, []) + ViewDesignId = <<"_design/", ViewDesignName/binary>> end, - ViewLang = proplists:get_value(<<"language">>, ViewProps, <<"javascript">>), + ListLang = proplists:get_value(<<"language">>, ListProps, <<"javascript">>), ListSrc = couch_util:get_nested_json_value({ListProps}, [<<"lists">>, ListName]), - send_view_list_response(ViewLang, ListSrc, ViewName, ViewDesignId, Req, Db, Keys). + send_view_list_response(ListLang, ListSrc, ViewName, ViewDesignId, Req, Db, Keys). send_view_list_response(Lang, ListSrc, ViewName, DesignId, Req, Db, Keys) -> |