Skip to content

Conversation

twFroggen
Copy link
Contributor

  • Template: Only set id='empty' when has_add_permission is True
  • JavaScript: Check template existence before cloning (click handler)
  • JavaScript: Check has_add_permission before showing add button
  • Align with Django's original tabular.html template behavior
  • Prevents users from adding inline items when has_add_permission returns False

Fixes issue where add button was clickable even without permission, causing JavaScript errors when attempting to clone non-existent template.

- Template: Only set id='empty' when has_add_permission is True
- JavaScript: Check template existence before cloning (click handler)
- JavaScript: Check has_add_permission before showing add button
- Align with Django's original tabular.html template behavior
- Prevents users from adding inline items when has_add_permission returns False

Fixes issue where add button was clickable even without permission,
causing JavaScript errors when attempting to clone non-existent template.
@lukasvinclav
Copy link
Contributor

Thanks for the PR. There is new functionality regarding the inlines which is fixing this issue.

#1570

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

Successfully merging this pull request may close these issues.

2 participants