Skip to content

Commit 3f8b5c2

Browse files
timgrahamaclark4life
authored andcommitted
remove EncryptedEmbeddedModel
1 parent d39f3b3 commit 3f8b5c2

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

django_mongodb_backend/models.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,3 @@ def delete(self, *args, **kwargs):
1414

1515
def save(self, *args, **kwargs):
1616
raise NotSupportedError("EmbeddedModels cannot be saved.")
17-
18-
19-
class EncryptedEmbeddedModel(EmbeddedModel):
20-
encrypted = True
21-
22-
class Meta:
23-
abstract = True
24-
required_db_features = {"supports_queryable_encryption"}

django_mongodb_backend/utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,4 @@ def wrapper(self, *args, **kwargs):
196196

197197

198198
def model_has_encrypted_fields(model):
199-
from django_mongodb_backend.models import EncryptedEmbeddedModel # noqa: PLC0415
200-
201-
for field in model._meta.fields:
202-
if getattr(field, "encrypted", False):
203-
return True
204-
205-
return bool(issubclass(model, EncryptedEmbeddedModel))
199+
return any(getattr(field, "encrypted", False) for field in model._meta.fields)

tests/encryption_/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
EncryptedTimeField,
2323
EncryptedURLField,
2424
)
25-
from django_mongodb_backend.models import EmbeddedModel, EncryptedEmbeddedModel
25+
from django_mongodb_backend.models import EmbeddedModel
2626

2727

28-
class Billing(EncryptedEmbeddedModel):
28+
class Billing(EmbeddedModel):
2929
cc_type = models.CharField(max_length=50)
3030
cc_number = models.CharField(max_length=20)
3131

0 commit comments

Comments
 (0)