redminetimesync
redminetimesync copied to clipboard
redmine.exceptions.ValidationError: Date is not a valid date
Trying to sync and get this error
./redminetimesync.py 2 Sync tasks for 09/02/15 ? Press ENTER to validate ... -> Connecting to Redmine... OK * [8.0h #1705]: #1705 Total : 8.0h Press ENTER to synchronize those tasks ... -> Sending entries . Traceback (most recent call last): File "./redminetimesync.py", line 281, insyncToRedmine(time_entries, date, redmine) File "./redminetimesync.py", line 169, in syncToRedmine comments=time_entry_infos['comment'] File "/usr/local/lib/python2.7/dist-packages/redmine/managers.py", line 180, in create response = self.redmine.request('post', url, data=data) File "/usr/local/lib/python2.7/dist-packages/redmine/__init__.py", line 143, in request raise ValidationError(to_string(', '.join(e if is_string(e) else ': '.join(e) for e in errors))) redmine.exceptions.ValidationError: Date is not a valid date
changing in syncToRedmine and add strftime like this spent_on=date.date.strftime("%Y-%m-%d"),
Fixed this error
I never experimented any errors like that one :confused:
Could you give me the Redmine version you're using ?
Thanks
Redmine version 2.5.2.stable.13345
Ruby version 1.9.3-p125 (2012-02-16) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter PostgreSQL
SCM:
Subversion 1.6.11
Git 1.7.1
Filesystem
Redmine plugins:
redmine_anonymous_authors 0.0.4
redmine_anonymous_watchers 0.1.0
redmine_custom_help_url 0.0.2
redmine_projects_accordion 0.1.0
redmine_spent_time 2.6.6
redmine_timetables 0.0.1
redmine_unassigned_issues 0.0.1
I wonder if it is anything with the default date format in the locale settings of the operating system, that makes it occur only for us who has something different than MM/DD/YY ?
thx @jhagberg , that worked OK. I've experienced this on debian with czech locale connecting to redmine 2.6.0.stable with czech lang used systemwide if that makes any difference
spent_on=date.date.strftime("%Y-%m-%d"),
Alternatively date.date.date().