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

fix: API get_view_name display the proper name for actions #5600

Merged
merged 13 commits into from
Apr 25, 2024

Conversation

nlgotz
Copy link
Contributor

@nlgotz nlgotz commented Apr 19, 2024

Closes #5595

What's Changed

  • Updates get_view_name() to get the view's name 1st if it exists.
  • Updates get_view_name() to check if it's not a detail view and get the model's verbose_name_plural name instead of the verbose_name
  • Update @action decorators that have a function with a multipart name to add in the name arg so that the Extra Action displays nicely

Screenshots

Before:
image

After:
image

TODO

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Example App Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

nautobot/core/api/utils.py Outdated Show resolved Hide resolved
nautobot/core/api/utils.py Show resolved Hide resolved
@nlgotz nlgotz marked this pull request as ready for review April 20, 2024 04:27
nautobot/core/api/utils.py Show resolved Hide resolved
nautobot/core/tests/test_api.py Outdated Show resolved Hide resolved
@glennmatthews glennmatthews merged commit 27958da into nautobot:develop Apr 25, 2024
17 checks passed
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.

DRF Action names not correct
2 participants