Opened 12 years ago

Closed 12 years ago

#20509 closed Bug (fixed)

--pks option in dumpdata command raises exception

Reported by: Weipin Xia Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Release blocker Keywords:
Cc: bmispelon@… 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

Issuing dumpdata command with --pks option results in a AttributeError exception.

 ./manage.py dumpdata appname --pks 1
 ...
 AttributeError: 'list' object has no attribute 'split'

Attachments (1)

patch.diff (771 bytes ) - added by Weipin Xia 12 years ago.

Download all attachments as: .zip

Change History (6)

by Weipin Xia, 12 years ago

Attachment: patch.diff added

comment:1 by Claude Paroz, 12 years ago

Needs tests: set
Patch needs improvement: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Baptiste Mispelon, 12 years ago

Cc: bmispelon@… added
Patch needs improvement: unset

The proposed patch just removes the (documented) ability to pass a comma-separated list of primary keys.

Here's my attempt at a better patch: https://github.com/django/django/pull/1227

I'm not too sure how to write a regression test for this though...

comment:3 by Tim Graham, 12 years ago

Needs tests: unset

Added a test in this pull request: https://github.com/django/django/pull/1231

comment:4 by Baptiste Mispelon, 12 years ago

Triage Stage: AcceptedReady for checkin

Looks good.

The added test fails without the patch and passes when it's applied.

I'm marking this as RFC.

comment:5 by Tim Graham <timograham@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 59235816bd063cb8b24acfc92ae1b5cd09a1f7ba:

Fixed #20509 - Proper parsing for dumpdata --pks option.

Thanks weipin for the report and Baptiste Mispelon for the patch.

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