Skip to content

Commit

Permalink
Fixes #8761: Correct view name resolution under journal entry views
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Feb 28, 2022
1 parent 7823fa0 commit da6ed8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/version-3.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Where it is desired to limit the range of available VLANs within a group, users
* [#8671](https://github.com/netbox-community/netbox/issues/8671) - Fix AttributeError when viewing console/power/interface connection lists
* [#8682](https://github.com/netbox-community/netbox/issues/8682) - Limit available VLANs by group min/max VIDs
* [#8683](https://github.com/netbox-community/netbox/issues/8683) - Fix `ZoneInfoNotFoundError` exception under Python 3.9+
* [#8761](https://github.com/netbox-community/netbox/issues/8761) - Correct view name resolution under journal entry views

### Other Changes

Expand Down
6 changes: 3 additions & 3 deletions netbox/extras/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from netbox.views import generic
from utilities.forms import ConfirmationForm
from utilities.htmx import is_htmx
from utilities.utils import copy_safe_request, count_related, normalize_querydict, shallow_compare_dict
from utilities.utils import copy_safe_request, count_related, get_viewname, normalize_querydict, shallow_compare_dict
from utilities.views import ContentTypePermissionRequiredMixin
from . import filtersets, forms, tables
from .choices import JobResultStatusChoices
Expand Down Expand Up @@ -478,7 +478,7 @@ def get_return_url(self, request, instance):
if not instance.assigned_object:
return reverse('extras:journalentry_list')
obj = instance.assigned_object
viewname = f'{obj._meta.app_label}:{obj._meta.model_name}_journal'
viewname = get_viewname(obj, 'journal')
return reverse(viewname, kwargs={'pk': obj.pk})


Expand All @@ -487,7 +487,7 @@ class JournalEntryDeleteView(generic.ObjectDeleteView):

def get_return_url(self, request, instance):
obj = instance.assigned_object
viewname = f'{obj._meta.app_label}:{obj._meta.model_name}_journal'
viewname = get_viewname(obj, 'journal')
return reverse(viewname, kwargs={'pk': obj.pk})


Expand Down

0 comments on commit da6ed8e

Please sign in to comment.