From ee469f6aa676d24a9492dc13e9afa738ddc18e5d Mon Sep 17 00:00:00 2001 From: Tom Kazimiers Date: Mon, 16 Dec 2024 20:53:30 +0100 Subject: [PATCH] Fix Django 4 upgrade error --- django/lib/custom_rest_swagger_googledoc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/lib/custom_rest_swagger_googledoc.py b/django/lib/custom_rest_swagger_googledoc.py index f4d36e3b64..8dbb5817ca 100644 --- a/django/lib/custom_rest_swagger_googledoc.py +++ b/django/lib/custom_rest_swagger_googledoc.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.utils.safestring import mark_safe -from django.utils.encoding import smart_text +from django.utils.encoding import smart_str from rest_framework.utils import formatting @@ -21,7 +21,7 @@ def get_googledocstring(view_cls, html=False): description = view_cls.__doc__ or '' config = Config(napoleon_use_param=False, napoleon_use_rtype=False) description = GoogleDocstring(description, config=config) - description = formatting.dedent(smart_text(description)) + description = formatting.dedent(smart_str(description)) if html: parts = core.publish_parts(source=description, writer_name='html') html = parts['body_pre_docinfo'] + parts['fragment']