Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ManagementForm data is missing or has been tampered with #164

Closed
ADR-007 opened this issue Feb 20, 2020 · 4 comments
Closed

Error: ManagementForm data is missing or has been tampered with #164

ADR-007 opened this issue Feb 20, 2020 · 4 comments

Comments

@ADR-007
Copy link

ADR-007 commented Feb 20, 2020

Hi! Could you please help me with my problem?

Steps to reproduce:

  1. Make the first level polymorphic inline
  2. Make the second level polymorphic inline (without this everything is OK)
  3. Go to "add new item"
  4. Create an empty inline item
  5. Click "save"
  6. See validation error (because it has required fields)
  7. Add another empty inline item
  8. There no second-level items anymore
  9. Click "save"
  10. See error: ManagementForm data is missing or has been tampered with
@ADR-007
Copy link
Author

ADR-007 commented Feb 20, 2020

It doesn't send form fields like:

firstlevel-0-secondlevel-2-INITIAL_FORMS: 0
firstlevel-0-secondlevel-2-MAX_NUM_FORMS: 1000
firstlevel-0-secondlevel-2-MIN_NUM_FORMS: 0
firstlevel-0-secondlevel-2-TOTAL_FORMS: 0
firstlevel-0-secondlevel-2-__prefix__-somefield: 
...
firstlevel-empty-secondlevel-2-INITIAL_FORMS: 0
firstlevel-empty-secondlevel-2-MAX_NUM_FORMS: 1000
firstlevel-empty-secondlevel-2-MIN_NUM_FORMS: 0
firstlevel-empty-secondlevel-2-TOTAL_FORMS: 0
firstlevel-empty-secondlevel-2-__prefix__-somefield: 

in the second atempt

@ADR-007
Copy link
Author

ADR-007 commented Feb 20, 2020

image

@ADR-007
Copy link
Author

ADR-007 commented Mar 18, 2020

I found the solution!

Just change this line:

if request.method == 'GET':

to:

if request.method in ['GET', 'POST']:

@ADR-007
Copy link
Author

ADR-007 commented Apr 4, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant