Skip to content

Commit 071192e

Browse files
committed
Add deconstruct method for encryption fields
1 parent 9a3c18e commit 071192e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

django_mongodb_backend/fields/encryption.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@ class EncryptedCharField(models.CharField):
88
def __init__(self, *args, queries=None, **kwargs):
99
self.queries = queries
1010
super().__init__(*args, **kwargs)
11+
12+
def deconstruct(self):
13+
name, path, args, kwargs = super().deconstruct()
14+
if path.startswith("django_mongodb_backend.fields.encryption"):
15+
path = path.replace(
16+
"django_mongodb_backend.fields.encryption",
17+
"django_mongodb_backend.fields",
18+
)
19+
return name, path, args, kwargs

0 commit comments

Comments
 (0)