From d1c827d648cff9ff60350e2d20d304b3741ab265 Mon Sep 17 00:00:00 2001 From: ron Date: Sun, 26 Mar 2023 14:44:18 +0300 Subject: [PATCH] force_text is depcrecated + bump version (django 4 upgrade) --- fernet_fields/__init__.py | 2 +- fernet_fields/fields.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fernet_fields/__init__.py b/fernet_fields/__init__.py index 0d90875..4143273 100644 --- a/fernet_fields/__init__.py +++ b/fernet_fields/__init__.py @@ -1,3 +1,3 @@ from .fields import * # noqa -__version__ = '0.5.1.2' +__version__ = '0.5.1.3' diff --git a/fernet_fields/fields.py b/fernet_fields/fields.py index cb43a42..02f4783 100644 --- a/fernet_fields/fields.py +++ b/fernet_fields/fields.py @@ -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 @@ -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):