not successfull project creation log full response from clockify

This commit is contained in:
iLLiCiTiT 2020-07-14 11:23:51 +02:00
parent 8e05b9f33c
commit 6d8148af6b

View file

@ -81,13 +81,18 @@ class SyncClocify(BaseAction):
clockify_projects = self.clockapi.get_projects()
if project_name not in clockify_projects:
response = self.clockapi.add_project(project_name)
if 'id' not in response:
self.log.error('Project {} can\'t be created'.format(
project_name
))
if "id" not in response:
self.log.warning(
"Project \"{}\" can't be created. Response: {}".format(
project_name, response
)
)
return {
'success': False,
'message': 'Can\'t create project, unexpected error'
"success": False,
"message": (
"Can't create clockify project \"{}\"."
" Unexpected error."
).format(project_name)
}
clockify_workspace_tags = self.clockapi.get_tags()