8000 Remove usage of deprecated functions not supported in Django 4.0 by jackton1 · Pull Request #66 · 5monkeys/django-enumfield · GitHub
[go: up one dir, main page]

Skip to content

Remove usage of deprecated functions not supported in Django 4.0 #66

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

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions django_enumfield/db/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import six
from django import forms
from django.db import models
from django.utils.encoding import force_text
from django.utils.translation import ugettext
from django.utils.encoding import force_str
from django.utils.translation import gettext

from django_enumfield.exceptions import InvalidStatusOperationError
from django_enumfield.forms.fields import EnumChoiceField
Expand Down Expand Up @@ -66,7 +66,7 @@ def _get_FIELD_display(self, cls):
value = getattr(cls, self.attname)
if value is None:
return value
return force_text(value.label, strings_only=True)
return force_str(value.label, strings_only=True)

def get_prep_value(self, value):
value = super(EnumField, self).get_prep_value(value)
Expand Down Expand Up @@ -119,7 +119,7 @@ def set_enum(self, new_value):
new_value = enum(new_value)
except ValueError:
raise InvalidStatusOperationError(
ugettext(
gettext(
six.text_type(
"{value!r} is not one of the available choices "
"for enum {enum}."
Expand Down
0