Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProjectAPI (api_projects_post) timeBudget & budget fields errors #5

Open
mike1573 opened this issue Aug 15, 2020 · 4 comments
Open

Comments

@mike1573
Copy link

mike1573 commented Aug 15, 2020

Getting "value should not be null" errors after posting a new project via the API following the documentation.

Code:

    api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
    body = kimai_python.ProjectEditForm('Test', 'Test', None, None, None, None, 1, 'd2d6de', 1)
    api_response = api_instance.api_projects_post(body)

Error:
Traceback (most recent call last):
File "taskhub.py", line 362, in
start()
File "taskhub.py", line 217, in start
api_response = proj_instance.api_projects_post('Wipro - Ingredion', 'Wipro - Ingredion', None, None, None, None, 1, 'd2d6de', 1)
TypeError: api_projects_post() takes 2 positional arguments but 10 were given
(kimai-env) gooncal@ip-72-167-226-99:~/kimai_api$ python taskhub.py
Traceback (most recent call last):
File "taskhub.py", line 362, in
start()
File "taskhub.py", line 217, in start
api_response = proj_instance.api_projects_post(obody)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api/pro ject_api.py", line 748, in api_projects_post
(data) = self.api_projects_post_with_http_info(body, **kwargs) # noqa: E501
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api/pro ject_api.py", line 818, in api_projects_post_with_http_info
collection_formats=collection_formats)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api_cli ent.py", line 330, in call_api
_preload_content, _request_timeout)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api_cli ent.py", line 161, in __call_api
_request_timeout=_request_timeout)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/api_cli ent.py", line 373, in request
body=body)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/rest.py ", line 275, in POST
body=body)
File "/home/gooncal/kimai-env/lib/python3.6/site-packages/kimai_python/rest.py ", line 228, in request
raise ApiException(http_resp=r)
kimai_python.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Date': 'Sat, 15 Aug 2020 13:32:55 GMT', 'Server': 'Apache/2.4.18 (Ubuntu)', 'Cache-Control': 'max-age=0, must-revalidate , private', 'Expires': 'Sat, 15 Aug 2020 13:32:55 GMT', 'Set-Cookie': 'PHPSESSID =77m9g58k2kvuvr3u2cg5p0k7id; path=/; HttpOnly', 'Connection': 'close', 'Transfer -Encoding': 'chunked', 'Content-Type': 'application/json'})
HTTP response body: {"code":400,"message":"Validation Failed","errors":{"childre n":{"name":{},"comment":{},"orderNumber":{},"orderDate":{},"start":{},"end":{}," customer":{},"color":{},"budget":{"errors":["This value should not be null."]}," timeBudget":{"errors":["This value should not be null."]},"visible":{}}}}

@MPW1412
Copy link
Contributor

MPW1412 commented Aug 17, 2020

Hi,

this has been fixed in Kimai itself. Are you testing against the latest version?

#1

Best,
Matthias

@mike1573
Copy link
Author

mike1573 commented Aug 17, 2020 via email

@kbancerz
Copy link
Owner

Version 0.2.9 was generated for the upcoming 1.10. Please try kimai-python 0.2.7 for Kimai 1.9.

@mike1573
Copy link
Author

Working now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants