mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #13513: Prevent exception when rendering bookmarks widget for anonymous user
This commit is contained in:
parent
229007082b
commit
7d7e8127f5
@ -346,6 +346,9 @@ class BookmarksWidget(DashboardWidget):
|
|||||||
def render(self, request):
|
def render(self, request):
|
||||||
from extras.models import Bookmark
|
from extras.models import Bookmark
|
||||||
|
|
||||||
|
if request.user.is_anonymous:
|
||||||
|
bookmarks = list()
|
||||||
|
else:
|
||||||
bookmarks = Bookmark.objects.filter(user=request.user).order_by(self.config['order_by'])
|
bookmarks = Bookmark.objects.filter(user=request.user).order_by(self.config['order_by'])
|
||||||
if object_types := self.config.get('object_types'):
|
if object_types := self.config.get('object_types'):
|
||||||
models = get_models_from_content_types(object_types)
|
models = get_models_from_content_types(object_types)
|
||||||
|
Loading…
Reference in New Issue
Block a user