Skip to content

Commit

Permalink
force_text is depcrecated + bump version (django 4 upgrade)
Browse files Browse the repository at this point in the history
  • Loading branch information
RonShub committed Mar 26, 2023
1 parent 22014e4 commit d1c827d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fernet_fields/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .fields import * # noqa

__version__ = '0.5.1.2'
__version__ = '0.5.1.3'
4 changes: 2 additions & 2 deletions fernet_fields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.conf import settings
from django.core.exceptions import FieldError, ImproperlyConfigured
from django.db import models
from django.utils.encoding import force_bytes, force_text
from django.utils.encoding import force_bytes, force_str
from django.utils.functional import cached_property

from . import hkdf
Expand Down Expand Up @@ -102,7 +102,7 @@ def from_db_value(self, value, expression, connection, context):
if value is not None:
if value not in self.allowed_unencrypted_values:
value = self.fernet.decrypt(force_bytes(value))
return self.to_python(force_text(value))
return self.to_python(force_str(value))

@cached_property
def validators(self):
Expand Down

0 comments on commit d1c827d

Please sign in to comment.