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

Move ObjectChange creation into signal receivers

This commit is contained in:
Jeremy Stretch
2020-08-14 17:03:45 -04:00
parent b4299241fe
commit 4ee8e473eb
6 changed files with 89 additions and 141 deletions

View File

@@ -3,20 +3,6 @@ from django.db.models import Q, QuerySet
from utilities.permissions import permission_is_exempt
class DummyQuerySet:
"""
A fake QuerySet that can be used to cache relationships to objects that have been deleted.
"""
def __init__(self, queryset):
self._cache = [obj for obj in queryset.all()]
def __iter__(self):
return iter(self._cache)
def all(self):
return self._cache
class RestrictedQuerySet(QuerySet):
def restrict(self, user, action='view'):