Opened 10 years ago
Closed 10 years ago
#25106 closed Bug (invalid)
ManagementForm data is missing or has been tampered with "admin"
| Reported by: | Felipe | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | 1.8 |
| Severity: | Normal | Keywords: | admin, inlines, forms, formsets |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I have note an incidence on the admin, That only happens when change the condition.
inlines = [ProductImageInline, AttributeInline]
def get_formsets_with_inlines(self, request, obj=None):
"""
Yields formsets and the corresponding inlines.
"""
for inline in self.get_inline_instances(request, obj):
if obj is None and isinstance(inline, tuple(self.inlines)):
continue
# Here problem when already create obj, and try change parent return
#: Exception Value: ['ManagementForm data is missing or has been tampered with']
elif obj.is_parent and isinstance(inline, ProductImageInline):
continue
yield inline.get_formset(request, obj), inline
Depending on whether the object is parent or not, will decide if to show some Inline,
Change History (2)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
You may need to add some custom JavaScript to modify the management form to handle this case. I don't think Django can generically handle arbitrary get_formsets_with_inlines() methods like this one.
Note:
See TracTickets
for help on using tickets.
not enough information to determine the cause of your problem, because you are give an example to your classes without theirs code