Jeremy Stretch 6 лет назад
Родитель
Сommit
6ab56c3978
3 измененных файлов с 11 добавлено и 3 удалено
  1. 2 2
      CHANGELOG.md
  2. 5 1
      netbox/dcim/api/views.py
  3. 4 0
      netbox/extras/admin.py

+ 2 - 2
CHANGELOG.md

@@ -29,8 +29,8 @@ Django 2.1 introduced the ability to enforce view-only permissions for different
 these by default. You can grant view permission to a user or group by assigning the "can view" permission for the
 these by default. You can grant view permission to a user or group by assigning the "can view" permission for the
 desired object(s).
 desired object(s).
 
 
-To exempt certain objects from the enforcement of view permissions, so that any user (including anonymous users) can
-view them, add them to the new `EXEMPT_VIEW_PERMISSIONS` setting in `configuration.py`:
+To exempt certain object types from the enforcement of view permissions, so that any user (including anonymous users)
+can view them, add them to the new `EXEMPT_VIEW_PERMISSIONS` setting in `configuration.py`:
 
 
 ```
 ```
 EXEMPT_VIEW_PERMISSIONS = [
 EXEMPT_VIEW_PERMISSIONS = [

+ 5 - 1
netbox/dcim/api/views.py

@@ -595,7 +595,11 @@ class PowerPanelViewSet(ModelViewSet):
 #
 #
 
 
 class PowerFeedViewSet(CustomFieldModelViewSet):
 class PowerFeedViewSet(CustomFieldModelViewSet):
-    queryset = PowerFeed.objects.select_related('power_panel', 'rack').prefetch_related('tags')
+    queryset = PowerFeed.objects.select_related(
+        'power_panel', 'rack'
+    ).prefetch_related(
+        'tags'
+    )
     serializer_class = serializers.PowerFeedSerializer
     serializer_class = serializers.PowerFeedSerializer
     filterset_class = filters.PowerFeedFilter
     filterset_class = filters.PowerFeedFilter
 
 

+ 4 - 0
netbox/extras/admin.py

@@ -86,6 +86,10 @@ class CustomLinkForm(forms.ModelForm):
     class Meta:
     class Meta:
         model = CustomLink
         model = CustomLink
         exclude = []
         exclude = []
+        help_texts = {
+            'text': 'Jinja2 template code for the link text. Reference the object as <code>{{ obj }}</code>.',
+            'url': 'Jinja2 template code for the link URL. Reference the object as <code>{{ obj }}</code>.',
+        }
 
 
     def __init__(self, *args, **kwargs):
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
         super().__init__(*args, **kwargs)