Merge pull request #1310 from AlanCoding/null_encrypted

do not server error if this value is None
This commit is contained in:
Alan Rominger
2018-04-10 12:52:56 -04:00
committed by GitHub

View File

@@ -839,6 +839,6 @@ class OAuth2ClientSecretField(models.CharField):
)
def from_db_value(self, value, expression, connection, context):
if value.startswith('$encrypted$'):
if value and value.startswith('$encrypted$'):
return decrypt_value(get_encryption_key('value', pk=None), value)
return value