unfoldadmin / django-unfold

Modern Django admin theme for seamless interface development
https://unfoldadmin.com
MIT License
1.95k stars 188 forks source link

Seems like StackedInline is broken if no records found #753

Closed skazancev closed 2 months ago

skazancev commented 2 months ago

What version of Unfold are you using?

Version: 0.38.0

What version of Django are you using?

For example: 5.1.1

What browser are you using?

For example: Doesn't matter

Did you checked changelog/commit history, if the bug is not already fixed? Bug is in this commit

Are you able to replicate the bug in the demo site?

image

No add another record button, there is should be an additional condition if not inline_admin_formset.has_add_permission on line 16 in stacked.html (like in tabular.html)

So the final code on line 16 is: {% if not inline_admin_formset.has_add_permission and inline_admin_formset.forms|length == 0 %}

lukasvinclav commented 2 months ago

Yes, you are right. This is duplicate of #735. I will take a look on that.

lukasvinclav commented 2 months ago

Thanks. Fixed in https://github.com/unfoldadmin/django-unfold/pull/758

skazancev commented 2 months ago

Good job, thank you!

lukasvinclav commented 2 months ago

Did you tested it?