No bounds checking when adding/subtracting months
|Reported by:||anonymous||Owned by:||Bhuricha Deen Sethanandha|
There are several locations in web_ui.py where a month is passed into datetime as a parameter. Many instances pass in month+1 or month-1. These calls fail when month is December and January, since Dec = 12 and 12 +1 = 13 and since Jan = 1 and 1-1 = 0. datetime requires that the month be between 1 and 12. It is probably better when performing math on months to use a datetime object for the current month and then add/subtract timedelta(months=1). Then access the month attribute of the resulting datetime object. An example of the error can be found in the last_day_of_month method.