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

Housekeeping: Use RestrictedQuerySet for default manager on base models

This commit is contained in:
jeremystretch
2021-11-11 15:04:22 -05:00
parent 834f68e6e4
commit d529c1b5b3
21 changed files with 7 additions and 108 deletions

View File

@@ -125,8 +125,6 @@ class Webhook(ChangeLoggedModel):
'Leave blank to use the system defaults.'
)
objects = RestrictedQuerySet.as_manager()
class Meta:
ordering = ('name',)
unique_together = ('payload_url', 'type_create', 'type_update', 'type_delete',)
@@ -222,8 +220,6 @@ class CustomLink(ChangeLoggedModel):
help_text="Force link to open in a new window"
)
objects = RestrictedQuerySet.as_manager()
class Meta:
ordering = ['group_name', 'weight', 'name']
@@ -268,8 +264,6 @@ class ExportTemplate(ChangeLoggedModel):
help_text="Download file as attachment"
)
objects = RestrictedQuerySet.as_manager()
class Meta:
ordering = ['content_type', 'name']
unique_together = [
@@ -429,8 +423,6 @@ class JournalEntry(ChangeLoggedModel):
)
comments = models.TextField()
objects = RestrictedQuerySet.as_manager()
class Meta:
ordering = ('-created',)
verbose_name_plural = 'journal entries'

View File

@@ -7,7 +7,6 @@ from extras.utils import extras_features
from netbox.models import BigIDModel, ChangeLoggedModel
from utilities.choices import ColorChoices
from utilities.fields import ColorField
from utilities.querysets import RestrictedQuerySet
#
@@ -24,8 +23,6 @@ class Tag(ChangeLoggedModel, TagBase):
blank=True,
)
objects = RestrictedQuerySet.as_manager()
class Meta:
ordering = ['name']