#23552: Bad request (Error 400) on almost all inline adding calls
-------------------------------------+-------------------------------------
Reporter: nux17 | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.7
Severity: Release blocker | Resolution:
Keywords: inline, error, | Triage Stage:
http, response, 400 | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by amorce):
* cc: amorce (added)
* status: closed => new
* resolution: duplicate =>
Comment:
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"
--
Ticket URL: <https://code.djangoproject.com/ticket/23552#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.8cc540606747b069fa87ad98f6bd3cac%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.