mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-09 21:32:17 -06:00
Use reverse_lazy instead of reverse
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Sequence, Optional
|
from typing import Sequence, Optional
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse_lazy
|
||||||
|
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
@@ -30,7 +30,7 @@ class MenuItemButton:
|
|||||||
|
|
||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
if self.link:
|
if self.link:
|
||||||
self._url = reverse(self.link)
|
self._url = reverse_lazy(self.link)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def url(self):
|
def url(self):
|
||||||
@@ -54,7 +54,7 @@ class MenuItem:
|
|||||||
|
|
||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
if self.link:
|
if self.link:
|
||||||
self._url = reverse(self.link)
|
self._url = reverse_lazy(self.link)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def url(self):
|
def url(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user