mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-26 18:38:38 -06:00
Fixes for anonimous user
Added check if user is authenticated Deleted debbuging output
This commit is contained in:
parent
5ca574d346
commit
58c06aad5a
@ -328,6 +328,8 @@ class RackElevationListView(generic.ObjectListView):
|
||||
if rack_face not in DeviceFaceChoices.values():
|
||||
rack_face = DeviceFaceChoices.FACE_FRONT
|
||||
|
||||
user_config = request.user.config if request.user.is_authenticated else {}
|
||||
|
||||
return render(request, 'dcim/rack_elevation_list.html', {
|
||||
'paginator': paginator,
|
||||
'page': page,
|
||||
@ -365,7 +367,8 @@ class RackView(generic.ObjectView):
|
||||
|
||||
device_count = Device.objects.restrict(request.user, 'view').filter(rack=instance).count()
|
||||
|
||||
print(request.user.config.get('rack_elevation.show_images'))
|
||||
user_config = request.user.config if request.user.is_authenticated else {}
|
||||
|
||||
return {
|
||||
'device_count': device_count,
|
||||
'reservations': reservations,
|
||||
|
@ -174,7 +174,6 @@ def deepmerge(original, new):
|
||||
Deep merge two dictionaries (new into original) and return a new dict
|
||||
"""
|
||||
merged = OrderedDict(original)
|
||||
print(original, new)
|
||||
for key, val in new.items():
|
||||
if key in original and isinstance(original[key], dict) and isinstance(val, dict):
|
||||
merged[key] = deepmerge(original[key], val)
|
||||
|
Loading…
Reference in New Issue
Block a user