File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -427,9 +427,7 @@ def _create_collection(self, model):
427
427
"""
428
428
429
429
db = self .get_database ()
430
- if not hasattr (model , "encrypted" ):
431
- db .create_collection (model ._meta .db_table )
432
- else :
430
+ if hasattr (model , "encrypted" ) and model .encrypted :
433
431
client = self .connection .connection
434
432
ce = get_client_encryption (
435
433
client ,
@@ -442,14 +440,19 @@ def _create_collection(self, model):
442
440
self ._get_encrypted_fields_map (model ),
443
441
settings .KMS_PROVIDER ,
444
442
)
443
+ else :
444
+ db .create_collection (model ._meta .db_table )
445
445
446
446
def _get_encrypted_fields_map (self , model ):
447
447
conn = self .connection
448
448
fields = model ._meta .fields
449
449
return {
450
450
"fields" : [
451
451
{
452
- "path" : field .db_column ,
452
+ # (Pdb) fields[2].db_column
453
+ # (Pdb) fields[2].name
454
+ # 'ssn'
455
+ "path" : field .name ,
453
456
"bsonType" : field .db_type (conn ),
454
457
# Specify queries in the field definition as a list of query
455
458
# types e.g. queries=["equality", "range"]
You can’t perform that action at this time.
0 commit comments