Opened 13 years ago

Closed 13 years ago

#3640 closed (fixed)

Missing or mistyped 'language' parameter on /i18n/setlang/ raises a MultiValueDictKeyError

Reported by: Jorge Gajon <gajon@…> Owned by: hugo
Component: Internationalization Version: master
Severity: Keywords: i18n
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


Django provides a setlang/ url which calls django.views.i18n.set_language(). This view expects to find a language paremeter in request.GET, but when this parameter is missing (or was mistyped) an exception is raised; which will generate 500 Server Error pages in production sites.

Attached is a very simple patch. When the language parameter is missing the view will behave as if the language specified was invalid.

Attachments (1)

i18n_set_language.diff (924 bytes) - added by Jorge Gajon <gajon@…> 13 years ago.
Avoid MultiValueDictKeyError in set_language() view

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by Jorge Gajon <gajon@…>

Attachment: i18n_set_language.diff added

Avoid MultiValueDictKeyError in set_language() view

comment:1 Changed 13 years ago by Simon G. <dev@…>

Keywords: i18n added
Triage Stage: UnreviewedReady for checkin

comment:2 Changed 13 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [4708]) Fixed #3640 -- Improved error handling in views.i18n.set_language(). Thanks
Jorge Gajon.

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