Skip to content
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

Add support for django v4 #2

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion fernet_fields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
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
from django.utils.functional import cached_property

from .utils import force_text
from . import hkdf


Expand Down
7 changes: 6 additions & 1 deletion fernet_fields/test/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

from django.core.exceptions import FieldError, ImproperlyConfigured
from django.db import connection, models as dj_models
from django.utils.encoding import force_bytes, force_text
from django.utils.encoding import force_bytes
from django import VERSION as DJANGO_VERSION
if DJANGO_VERSION[0] < 3:
from django.utils.encoding import force_text
else:
from django.utils.encoding import force_str as force_text
import pytest

import fernet_fields as fields
Expand Down
11 changes: 11 additions & 0 deletions fernet_fields/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django import VERSION as DJANGO_VERSION

if DJANGO_VERSION[0] < 3:
from django.utils.encoding import force_text
else:
from django.utils.encoding import force_str as force_text


__all__ = [
"force_text"
]
Loading