Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Inline objects disappear on StackedInline when add is disabled #940

Closed
omargawdat opened this issue Jan 6, 2025 · 8 comments
Closed

Comments

@omargawdat
Copy link
Contributor

Unfold: Main Branch
Chrome: Latest

Bug:

StackedInline doesn't display objects when has_add_permission is False.

Notes:

  1. this issue doesn't exist in 0.43 version
  2. this issue doesn't exist in TabularInline

Not Working

class PackageAllocationInline(StackedInline):
    model = PackageAllocation
    extra = 0

    def has_add_permission(self, request, obj=None):
        return False
image

Working

class PackageAllocationInline(StackedInline):
    model = PackageAllocation
    extra = 0

    # def has_add_permission(self, request, obj=None):
    #     return False
image
@omargawdat omargawdat changed the title Bug: Inline objects disappear on making ta Bug: Inline objects disappear on StackedInline when add is disabled Jan 14, 2025
@AmirHbro
Copy link

Yeah the same happened to me too

@bek9
Copy link

bek9 commented Jan 15, 2025

It happens when extra = 0. You can see the add button if extra is greater than 0.

@lukasvinclav
Copy link
Contributor

@omargawdat @AmirHbro would you mind to test #972?

@omargawdat
Copy link
Contributor Author

@lukasvinclav I can confirm the issue has been solved thanks !

Image

@nickkrykunov
Copy link

Hi everyone!
Is there any chances we will have new release with fix in the nearest future?

@lukasvinclav
Copy link
Contributor

For now I recommend using branch #972. I have to do some additional testing. If you need to have it asap let me know through the form below:

https://unfoldadmin.com/consulting/

@nickkrykunov
Copy link

Thank you, @lukasvinclav!
I will use branch

@dirkmoors
Copy link

I can conform the behaviour;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants