doccano-client icon indicating copy to clipboard operation
doccano-client copied to clipboard

post_members

Open kovidiament opened this issue 4 years ago • 3 comments

How to reproduce the behaviour

pip install doccano-client , from doccano_api_client import DoccanoClient

Your Environment

  • Operating System: windows 10
  • Python Version: 3.7
  • Package Version: 1.02

Problem is, the post_member function in github does work in the pip installation. I get,

line 45, in members_add = doccano_client.post_members(project_id = project_info.id, usernames=userlist, roles=roleslist)

AttributeError: 'DoccanoClient' object has no attribute 'post_members'

I am also using PyCharm, and it does not recognize the function post_members.

Process finished with exit code 1

kovidiament avatar Jul 09 '21 14:07 kovidiament

How do I add members to a project programatically?

kovidiament avatar Jul 09 '21 14:07 kovidiament

@kovidiament What version of doccano-client have you pip installed? I was able to get the function working by referencing a specific hash which had that function. In my requirements.txt file I had doccano-client @ git+https://github.com/doccano/doccano-client.git@HASH

david-engelmann avatar Jun 01 '22 16:06 david-engelmann

@kovidiament in post members; role = list(filter(lambda role_info: role_info["rolename"] == rolename, res_roles)) line 944

res_roles has no key "rolename", it should be "name"

currently returns keyerror

JessicaOjo avatar Jun 10 '22 12:06 JessicaOjo