querysets.py 375 B

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