Opened 10 years ago
Closed 10 years ago
#23552 closed Bug (duplicate)
Bad request (Error 400) on almost all inline adding calls
Reported by: | Maxime BOGUTA | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.7 |
Severity: | Release blocker | Keywords: | inline, error, http, response, 400 |
Cc: | AMORCE | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hello,
I'm forwarding my Django setup to 1.7 and having a check for incompatibilites/bugs from my setup previously on 1.6.
Working on a test setup, I found out most of the adding inline (green crosses) models now retrieve a "Bad Request (400)" error. The URL seems to have changed from 1.6, but this seems to work with some inline calls (found one working and actually displaying the adding form).
Nothing on logs from Django, and Debug is set to True.
Cutting the URL from the slash '/' after 'add' just before the GET arguments (to_field=xxx&popup=1) brings the page up.
This is blocking my deployment, and after being investigating about this bug for half a day now I can't manage to find fix/info about it.
Attachments (1)
Change History (5)
by , 10 years ago
comment:1 by , 10 years ago
Component: | HTTP handling → contrib.admin |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
I'm pretty confident this a duplicate of #23431.
Can you confirm your issues are solved on the stable/1.7.x
branch? (pip uninstall django && pip install git+git://github.com/django/django.git@stable/1.7.x
.
The fix should be part of the 1.7.1
release.
comment:2 by , 10 years ago
Yep! Those issues are solved by your recommandations, everything is working on again.
If 1.7.1 is not to be released shortly, it has to be fixed in some other way as this is really release blocking.
Thank you!
comment:3 by , 10 years ago
Cc: | added |
---|---|
Resolution: | duplicate |
Status: | closed → new |
Hi,
This bug still occur with 1.7.1 when inlines are declared using get_inline_instances
models.py
class Invoice(models.Model): ... class Payment(models.Model): ... class InvoicePayment(models.Model): payment = models.OneToOneField(Payment) invoice = models.ForeignKey(Invoice)
admin.py:
class InvoicePaymentInline(admin.StackedInline): model = InvoicePayment extra = 1 class InvoiceAdmin(admin.ModelAdmin): #Using sample code from https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_inline_instances def get_inline_instances(self, request, obj=None): return [inline(self.model, self.admin_site) for inline in [InvoicePaymentInline]] # Register your models here. admin.site.register(Invoice, InvoiceAdmin) admin.site.register(Payment, )
In admin, from invoice change_form, click on "+" button next payment in inlines display popup with "bad request 400"
comment:4 by , 10 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Thanks for the report, I have moved this to a separate issue for clarity: #23754.
Error screenshot and reproducing steps.