Opened 10 years ago

Closed 10 years ago

#4270 closed (fixed)

immutable QueryDict allows deletion of keys

Reported by: Gary Wilson <gary.wilson@…> Owned by: Adrian Holovaty
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

>>> from django.http import QueryDict
>>> q=QueryDict('vote')
>>> q
<MultiValueDict: {'vote': ['']}>
>>> del q['vote']
>>> q
<MultiValueDict: {}>

Attachments (1)

4270.diff (1.1 KB) - added by Gary Wilson <gary.wilson@…> 10 years ago.
Added __delitem__ to QueryDict that checks if mutable. Tests too.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by Gary Wilson <gary.wilson@…>

Attachment: 4270.diff added

Added __delitem__ to QueryDict that checks if mutable. Tests too.

comment:1 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Has patch: set
Triage Stage: UnreviewedReady for checkin

comment:2 Changed 10 years ago by Malcolm Tredinnick

Nice catch, Gary. These little tidying-up patches you've been posting are very useful. Thanks.

comment:3 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [5187]) Fixed #4270 -- Don't permit deleting of items from an immutable QueryDict.
Thanks, Gary Wilson.

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