#35994: WeekArchiveView sometimes gets the next week year wrong in the last
week of
the year
-------------------------------------+-------------------------------------
Reporter: Nigel Metheringham | Type: Bug
Status: new | Component: Generic
| views
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
In some cases - for example ISO or Monday start weeks in 2024, the last
week of the year has the next week set as week 1 of 2024, and not week 1
of 2025.
Sample code:
{{{
class TicketScheduleWeekView(WeekArchiveView):
"""View of tickets scheduled for a week."""
# queryset = ## Queryset deleted as its quite large
date_field = "date"
week_format = "%W"
year_format = "%Y"
allow_future = True
allow_empty = True
}}}
Given the following URL definition:
{{{
path("ticketschedule/<int:year>/<int:week>/",
views.TicketScheduleWeekView.as_view(), name="ticket-schedule-week"),
}}}
We get for end of year links:-
- `/ticketschedule/2023/51/` - next week link is
`/ticketschedule/2023/52/`
- `/ticketschedule/2024/52/` - next week link is `/ticketschedule/2024/1/`
- `/ticketschedule/2024/51/` - next week link is
`/ticketschedule/2024/52/`
- `/ticketschedule/2024/52/` - next week link is
`/ticketschedule/2024/1/` **wrong**
--
Ticket URL: <https://code.djangoproject.com/ticket/35994>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070193b0cc1699-efa0254c-9d67-42c0-bdd6-c7d130abcc05-000000%40eu-central-1.amazonses.com.