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

Moved querysets to separate files; tweaked interface ordering logic (#1523)

This commit is contained in:
Jeremy Stretch
2017-10-10 17:23:41 -04:00
parent f824d1eb3b
commit 0c645b12d1
6 changed files with 127 additions and 115 deletions

View File

@@ -0,0 +1,13 @@
from __future__ import unicode_literals
from django.db.models import QuerySet
class UserKeyQuerySet(QuerySet):
def active(self):
return self.filter(master_key_cipher__isnull=False)
def delete(self):
# Disable bulk deletion to avoid accidentally wiping out all copies of the master key.
raise Exception("Bulk deletion has been disabled.")