Opened 18 years ago

Closed 18 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: dev
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

Description

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@…> 18 years ago.
Avoid MultiValueDictKeyError in set_language() view

Download all attachments as: .zip

Change History (3)

by Jorge Gajon <gajon@…>, 18 years ago

Attachment: i18n_set_language.diff added

Avoid MultiValueDictKeyError in set_language() view

comment:1 by Simon G. <dev@…>, 18 years ago

Keywords: i18n added
Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 18 years ago

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