Misc cleanup

This commit is contained in:
Jeremy Stretch 2019-04-19 14:56:40 -04:00
parent 5303d2c16d
commit 6ab56c3978
3 changed files with 11 additions and 3 deletions

View File

@ -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
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 = [

View File

@ -595,7 +595,11 @@ class PowerPanelViewSet(ModelViewSet):
#
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
filterset_class = filters.PowerFeedFilter

View File

@ -86,6 +86,10 @@ class CustomLinkForm(forms.ModelForm):
class Meta:
model = CustomLink
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):
super().__init__(*args, **kwargs)