Modify ↓
Opened 3 years ago
Closed 3 years ago
#14149 closed defect (fixed)
AttributeError: 'datetime.date' object has no attribute 'date'
| Reported by: | anonymous | Owned by: | lucid |
|---|---|---|---|
| Priority: | normal | Component: | WeekPlanPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: |
Description
2022-08-09 08:45:55,345 Trac[main] ERROR: [212.126.160.88] Internal Server Error: <RequestWithSession "GET '/weekplan?start=2022-08-08&end=2022-10-03'">
Traceback (most recent call last):
File "build\bdist.win-amd64\egg\trac\web\main.py", line 611, in dispatch_request
dispatcher.dispatch(req)
File "build\bdist.win-amd64\egg\trac\web\main.py", line 250, in dispatch
resp = chosen_handler.process_request(req)
File "build\bdist.win-amd64\egg\weekplan\core.py", line 196, in process_request
self._send_events(req, events)
File "build\bdist.win-amd64\egg\weekplan\core.py", line 213, in _send_events
self._send_json(req, [e.serialized(self.env, context) for e in events])
File "build\bdist.win-amd64\egg\weekplan\model.py", line 33, in serialized
'start': self.start.date().isoformat(),
AttributeError: 'datetime.date' object has no attribute 'date'
Attachments (0)
Change History (3)
comment:1 Changed 3 years ago by
comment:2 Changed 3 years ago by
Replacing this line with this seems to help:
- return WeekPlanEvent(str(entry_id), plan, title, start.dt, end.dt) + start = start.dt + end = end.dt + if isinstance(start, datetime.date): + start = datetime.datetime.combine(start, datetime.time(12, 0)) + if isinstance(end, datetime.date): + end = datetime.datetime.combine(end, datetime.time(12, 0)) + return WeekPlanEvent(str(entry_id), plan, title, start, end)
Note: See
TracTickets for help on using
tickets.



#14110 ical seems to give sometimes
datetime.datetime(OK) but sometimesdatetime.date(unexpected by WeekPlanPlugin).