Opened 12 hours ago

Last modified 5 hours ago

#36254 assigned Bug

Documentation 'Selecting the current time zone' code error

Reported by: YQ Owned by: YQ
Component: Documentation Version: dev
Severity: Normal Keywords: timezone items
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by YQ)

ValueError at /set_timezone/
Need 2 values to unpack in for loop; got 6.
Request Method: GET
Request URL: http://127.0.0.1:8000/set_timezone/
Django Version: 5.2b1
Exception Type: ValueError
Exception Value:
Need 2 values to unpack in for loop; got 6.

common_timezones = {
    "London": "Europe/London",
    "Paris": "Europe/Paris",
    "New York": "America/New_York",
}

...

return render(request, "template.html", {"timezones": common_timezones})

...

# template.html
{% for city, tz in timezones %}  # Error : Need 2 values to unpack in for loop; got 6. 
... 

it should be

{% for city, tz in timezones.items %}

https://github.com/django/django/pull/19270

According to the ticket's flags, the next step(s) to move this issue forward are:

  • For a Django committer to do a final review of the patch and merge it if all looks good.

Change History (4)

comment:1 by YQ, 11 hours ago

Has patch: set

comment:2 by YQ, 11 hours ago

Description: modified (diff)

comment:3 by Sarah Boyce, 10 hours ago

Triage Stage: UnreviewedAccepted
Version: 5.2dev

Thank you!

comment:4 by Sarah Boyce, 5 hours ago

Owner: set to YQ
Status: newassigned
Triage Stage: AcceptedReady for checkin
Note: See TracTickets for help on using tickets.
Back to Top