Opened 15 years ago

Closed 15 years ago

#9663 closed (duplicate)

save_as with inlines is broken after changeset 9297

Reported by: Andreas Pelme Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The save_as functionality fails after revision [9297] / [9298], when using inlines.

I have attached a patch with a updated admin_views test to include CHILD_set-N-PARENT for the ordinary change_form edit test, and I also added a test for save_as in the same test.

The test succeeds for revisions < [9297], since it simply does not care about the FK field.

It might be suitable for better tests for the formsets themselves, but I am not quite sure how to test them properly.

A comment in #8882 mentions this bug too (#8882 is the ticket that r9297 fixed)

If you like to test this manually, outside of the testsuite, I have also attached a test project with a sqlite database which can be used to test the bug right away:

  1. Admin login: test / test
  2. Open the existing "Parent"-object (change form) and hit "Save as new" without changing any fields.
  3. The first error is "Please correct the errors below."
  4. If you hit "Save" again, a KeyError will be raised and unhandled.

The unittest in the patch does *NOT* test for the KeyError-exception, since I am not sure if that is the proper thing to do here, or if that is related to this issue at all.

This bug affects both the 1.0.X branch and trunk.

Attachments (2)

save_as_inline_tests.diff (3.0 KB ) - added by Andreas Pelme 15 years ago.
Updated admin_views unit tests
save_as_inline.tar.gz (5.4 KB ) - added by Andreas Pelme 15 years ago.
Example project

Download all attachments as: .zip

Change History (3)

by Andreas Pelme, 15 years ago

Attachment: save_as_inline_tests.diff added

Updated admin_views unit tests

by Andreas Pelme, 15 years ago

Attachment: save_as_inline.tar.gz added

Example project

comment:1 by Karen Tracey, 15 years ago

Resolution: duplicate
Status: newclosed

#9651 already reported this. Thanks for the testcases, I've noted them in the previous ticket.

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