Project

General

Profile

python-redmine autherr

Added by 海洋 林 over 8 years ago

the python code is

url = "http://www.redmine.org" 
key = "993eb1cd7f27932cdafef282103def1b50cc93ba" 

wr = w2r(url,key)
for x in wr.getAllProject():
    print x.id,x.name
project = wr.getNewProject()
project.name = "Vacation" 
project.identifier = "hello redmine" 
project.description = "hahaha" 
# project.is_public = True
project.custom_fields = [{'id': 1, 'value': 'foo'}, {'id': 2, 'value': 'bar'}]
project.save()

and the output is:

"1 Redmine
Traceback (most recent call last):
  File "D:\EclipsePro\W2Redmine\handle.py", line 27, in <module>
    project.save()
  File "C:\Python27\lib\site-packages\python_redmine-1.2.0-py2.7.egg\redmine\resources.py", line 255, in save
    for item, value in self.manager.create(**self._changes):
  File "C:\Python27\lib\site-packages\python_redmine-1.2.0-py2.7.egg\redmine\managers.py", line 180, in create
    response = self.redmine.request('post', url, data=data)
  File "C:\Python27\lib\site-packages\python_redmine-1.2.0-py2.7.egg\redmine\__init__.py", line 130, in request
    raise AuthError
redmine.exceptions.AuthError: Invalid authentication details" 
but why