querysets.py 334 B

1234567891011
  1. from django.db.models import QuerySet
  2. class UserKeyQuerySet(QuerySet):
  3. def active(self):
  4. return self.filter(master_key_cipher__isnull=False)
  5. def delete(self):
  6. # Disable bulk deletion to avoid accidentally wiping out all copies of the master key.
  7. raise Exception("Bulk deletion has been disabled.")