Roundup Tracker - Issues

Issue 2550932

classification
html_calendar produces templating errors for bad date strings
Type: behavior Severity: normal
Components: Web interface Versions: 1.5
process
Status: fixed fixed
:
: rouilj : joseph_myers, rouilj
Priority: normal :

Created on 2017-01-16 13:17 by joseph_myers, last changed 2017-02-26 03:17 by rouilj.

Messages
msg5921 Author: [hidden] (joseph_myers) Date: 2017-01-16 13:17
Suppose you have a Date input field, and someone first enters a date in
that field in a format not recognized by Roundup, then uses the calendar
widget (_generic.calendar.html) to edit the date.

This uses html_calendar, which does

    curr_date = date.Date(date_str) # to highlight

which produces a Templating Error email to the admin with a backtrace
when it cannot parse the date.

Whatever is done with a badly formatted date - a message to the user
about valid date formats would seem sensible - giving a Templating Error
like that isn't user-friendly or the right thing to do.
msg5933 Author: [hidden] (rouilj) Date: 2017-02-26 03:17
Thanks for reporting that Joseph.

I had a little difficulty reproducing it. I was only able to
do it if I submitted an invalid date and got an error.

Once I did that the bad date was passed to the calendar popup.

I have changed to code to catch the error and highlight today's date in
the calendar.

I will open a new issue/feature request to enhance the calendar
popup and javascript code to use the current value in the date
field rather than the last submitted value.
History
Date User Action Args
2017-02-26 03:17:20rouiljsetstatus: new -> fixed
nosy: + rouilj
messages: + msg5933
priority: normal
assignee: rouilj
resolution: fixed
2017-01-16 13:17:25joseph_myerscreate