Skip to content

Commit

Permalink
Fix Django 4 upgrade error
Browse files Browse the repository at this point in the history
  • Loading branch information
tomka committed Dec 16, 2024
1 parent 9670d22 commit ee469f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/lib/custom_rest_swagger_googledoc.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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']
Expand Down

0 comments on commit ee469f6

Please sign in to comment.