Skip to content

fixed compatibility issue with django 5x #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fernet_fields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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 @@ -74,7 +74,7 @@ def get_db_prep_save(self, value, connection):
def from_db_value(self, value, expression, connection, *args):
if value is not None:
value = bytes(value)
return self.to_python(force_text(self.fernet.decrypt(value)))
return self.to_python(force_str(self.fernet.decrypt(value)))

@cached_property
def validators(self):
Expand Down