Code

Opened 7 years ago

Closed 7 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: UI/UX:

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

Download all attachments as: .zip

Change History (3)

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

Avoid MultiValueDictKeyError in set_language() view

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

  • Keywords i18n added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.