Fix up new Django 3.0 deprecations

Mostly text based: force/smart_text, ugettext_*
This commit is contained in:
Jeff Bradberry
2022-01-31 13:05:25 -05:00
parent efff85bc1f
commit a3a216f91f
91 changed files with 406 additions and 406 deletions

View File

@@ -2,7 +2,7 @@
# All Rights Reserved.
# Django
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
# Django REST Framework
from rest_framework.exceptions import ValidationError
@@ -13,7 +13,7 @@ class ActiveJobConflict(ValidationError):
def __init__(self, active_jobs):
# During APIException.__init__(), Django Rest Framework
# turn everything in self.detail into string by using force_text.
# turn everything in self.detail into string by using force_str.
# Declare detail afterwards circumvent this behavior.
super(ActiveJobConflict, self).__init__()
self.detail = {"error": _("Resource is being used by running jobs."), "active_jobs": active_jobs}