#30459: If a StackedInline has fieldsets with the "collapsed" class, the "Show"
link doesn't work on inline forms added with the "Add another [inline
object]" link
------------------------------------------------+------------------------
               Reporter:  Antonis Christofides  |          Owner:  nobody
                   Type:  Bug                   |         Status:  new
              Component:  contrib.admin         |        Version:  2.2
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  1                     |
------------------------------------------------+------------------------
 I attach a screenshot with explanations, which is the easiest way to get a
 grip of this problem.

 Steps to reproduce the problem illustrated in the screenshot:

 1. Create a {{{myblog}}} django project and a {{{blog}}} app.

 2. Specify this {{{models.py}}} in the {{{blog}}} app:
 {{{
 from django.db import models

 class BlogPost(models.Model):
     content = models.TextField()


 class Author(models.Model):
     blog_post = models.ForeignKey(BlogPost, on_delete=models.CASCADE)
     name = models.CharField(max_length=100)
     birthday = models.DateField(blank=True)
 }}}

 3. Specify this {{{admin.py}}}:
 {{{
 from django.contrib import admin

 from . import models


 class AuthorInline(admin.StackedInline):
     model = models.Author
     extra = 1
     fieldsets = [
         ("Essential", {"fields": ("name",), "classes": ("collapse",)}),
         ("Advanced", {"fields": ("birthday",), "classes": ("collapse",)}),
     ]


 @admin.register(models.BlogPost)
 class BlogPostAdmin(admin.ModelAdmin):
     inlines = [AuthorInline]
 }}}

 4. Add the {{{blog}}} app to {{{INSTALLED_APPS}}}, makemigrations,
 migrate, createsuperuser, runserver.

 5. Visit /admin/, login, go to "Blog posts", click on "Add new blog post",
 then click on "Add new Author".

 Result: The "Show" links on the new Author form don't work. See the
 screenshot for more information.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30459>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.205b40da058d910ed9638ff1a65f97cd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to