diff --git a/netbox/netbox/object_actions.py b/netbox/netbox/object_actions.py index b427d58cd..73315ce4c 100644 --- a/netbox/netbox/object_actions.py +++ b/netbox/netbox/object_actions.py @@ -1,4 +1,5 @@ from django.urls import reverse +from django.urls.exceptions import NoReverseMatch from django.utils.translation import gettext as _ from core.models import ObjectType @@ -42,7 +43,10 @@ class ObjectAction: kwargs = { kwarg: getattr(obj, kwarg) for kwarg in cls.url_kwargs } - return reverse(viewname, kwargs=kwargs) + try: + return reverse(viewname, kwargs=kwargs) + except NoReverseMatch: + return @classmethod def get_context(cls, context, obj): diff --git a/netbox/utilities/templates/buttons/bulk_rename.html b/netbox/utilities/templates/buttons/bulk_rename.html index 376faa88b..6e268cc62 100644 --- a/netbox/utilities/templates/buttons/bulk_rename.html +++ b/netbox/utilities/templates/buttons/bulk_rename.html @@ -1,3 +1,5 @@ - +{% if url %} + +{% endif %}