mirror of
https://github.com/jazzband/django-fernet-encrypted-fields.git
synced 2026-03-16 22:40:27 +00:00
Since the field is always treated as TextField, we should return an empty string rather than None for those model fields that are not nullable.
This commit is contained in:
parent
755636a27a
commit
dcc42c9326
1 changed files with 1 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ class EncryptedFieldMixin(object):
|
|||
if not isinstance(value, str):
|
||||
value = str(value)
|
||||
return self.f.encrypt(bytes(value, "utf-8")).decode("utf-8")
|
||||
return None
|
||||
return ""
|
||||
|
||||
def get_db_prep_value(self, value, connection, prepared=False):
|
||||
if not prepared:
|
||||
|
|
|
|||
Loading…
Reference in a new issue