Opened 6 years ago

Closed 6 years ago

#29903 closed Cleanup/optimization (fixed)

Add friendly error message if WeekArchiveView receives an invalid week format

Reported by: Hasan Ramezani Owned by: Hasan Ramezani
Component: Generic views Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

when we use WeekArchiveView, we can determine the week_format in URL like this:

path('<int:year>/week/<int:week>/',  ArticleWeekArchiveView.as_view(week_format='%W'),  name="archive_week"),

The valid formats are: '%U' and %W. if we pass something else than those two formats we will get a KeyError.

I am gonna to fix this.

Change History (4)

comment:1 by Hasan Ramezani, 6 years ago

Owner: changed from nobody to Hasan Ramezani

comment:2 by Hasan Ramezani, 6 years ago

Has patch: set
Last edited 6 years ago by Tim Graham (previous) (diff)

comment:3 by Tim Graham, 6 years ago

Summary: Invalid week format in Generic date views WeekArchiveViewAdd friendly error message if WeekArchiveView receives an invalid week format
Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 4f8f1b2f:

Fixed #29903 -- Added error message for invalid WeekArchiveView week_format.

Note: See TracTickets for help on using tickets.
Back to Top