Only encrypt / decrypt fields with a value

This commit is contained in:
shamoon 2024-10-25 23:47:33 -07:00
parent 0a5066ebce
commit e2292ced40
No known key found for this signature in database
2 changed files with 8 additions and 6 deletions

View File

@ -565,6 +565,7 @@ class Command(CryptMixin, BaseCommand):
crypt_fields = crypt_config["fields"]
for manifest_record in manifest[exporter_key]:
for field in crypt_fields:
if manifest_record["fields"][field]:
manifest_record["fields"][field] = self.encrypt_string(
value=manifest_record["fields"][field],
)

View File

@ -414,6 +414,7 @@ class Command(CryptMixin, BaseCommand):
):
had_at_least_one_record = True
for field in crypt_fields:
if record["fields"][field]:
record["fields"][field] = self.decrypt_string(
value=record["fields"][field],
)