Commits

Virgil Dupras committed 272d09d

Fixed individual log entry which was broken.

Comments (0)

Files changed (1)

     def submitlogentry(self, logdate, logstart, logstop, project, task, comment):
         session = Session()
         dev = self.getuser(session)
-        start = '{} {}:00'.format(logdate, logstart)
-        stop = '{} {}:00'.format(logdate, logstop)
-        entry = (project, start, stop, task, comment)
+        TIMEFMT = '%Y-%m-%d %H:%M:%S'
+        start = datetime.strptime('{} {}:00'.format(logdate, logstart), TIMEFMT)
+        stop = datetime.strptime('{} {}:00'.format(logdate, logstop), TIMEFMT)
+        entry = TimelogData(project_name=project, start_time=start, stop_time=stop, task=task,
+            comment=comment)
         added, ignored = Timelog.add(session, dev, [entry], allow_backlog=True)
         Cache.clear(session)
         if added: