From 2a6fb3a87321ebcf6c0ea4c3b1d0d66285309198 Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Tue, 19 May 2020 19:21:11 -0700 Subject: [PATCH] serializers: import gettext_lazy; fixes #70 Per Django's warning, ugettext_lazy will be removed in a future version. --- dj_rest_auth/serializers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dj_rest_auth/serializers.py b/dj_rest_auth/serializers.py index 16ebebc..302be84 100644 --- a/dj_rest_auth/serializers.py +++ b/dj_rest_auth/serializers.py @@ -5,7 +5,10 @@ from django.contrib.auth.tokens import default_token_generator from django.utils.encoding import force_text from django.utils.http import urlsafe_base64_decode as uid_decoder from django.utils.module_loading import import_string -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import gettext_lazy as _ +except ImportError: + from django.utils.translation import ugettext_lazy as _ from rest_framework import exceptions, serializers from rest_framework.exceptions import ValidationError