1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Implement RestrictedQuerySet as a manager

This commit is contained in:
Jeremy Stretch
2020-05-29 16:27:36 -04:00
parent 5b6a6fb63e
commit e23b2c4c4f
16 changed files with 118 additions and 21 deletions

View File

@@ -17,6 +17,7 @@ from dcim.models import Device
from extras.models import CustomFieldModel, TaggedItem
from extras.utils import extras_features
from utilities.models import ChangeLoggedModel
from utilities.querysets import RestrictedQuerySet
from .exceptions import InvalidKey
from .hashers import SecretValidationHasher
from .querysets import UserKeyQuerySet
@@ -268,6 +269,8 @@ class SecretRole(ChangeLoggedModel):
blank=True
)
objects = RestrictedQuerySet.as_manager()
csv_headers = ['name', 'slug', 'description']
class Meta:
@@ -333,9 +336,10 @@ class Secret(ChangeLoggedModel, CustomFieldModel):
content_type_field='obj_type',
object_id_field='obj_id'
)
tags = TaggableManager(through=TaggedItem)
objects = RestrictedQuerySet.as_manager()
plaintext = None
csv_headers = ['device', 'role', 'name', 'plaintext']