Skip to content

_security object is an exception to the document model #238

Closed
@djc

Description

@djc

From pokstad@gmail.com on June 14, 2014 20:13:38

What steps will reproduce the problem? 1. Instantiate server:
server = couchdb.client.Server("http://admin:password@localhost:5984"
2. Try to set the _security object for a database you have admin privileges for:
server['test']['_security']={'members':{'names':[],'roles':['meow']},'admins':{'names':[],'roles':[]}} What is the expected output? What do you see instead? The expected outcome is that the method should return successfully, what happens is that an error is thrown:

server['test']['_security']={'members':{'names':[],'roles':['meow']},'admins':{'names':[],'roles':[]}}
Traceback (most recent call last):
File "", line 1, in
File "couchdb/client.py", line 351, in setitem
content.update({'_id': data['id'], '_rev': data['rev']})
KeyError: 'id'

This is likely due to the fact that the returned document does not have a _id or _rev attribute. This is because the security document is not a real document and does not follow the same rules as other documents in the database. What version of the product are you using? On what operating system? CouchDB 1.6 on Mac OS X using the latest version of couchdb-python in the repo.

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=238

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions