Skip to content

Commit

Permalink
Remove deprecated render functions
Browse files Browse the repository at this point in the history
  • Loading branch information
danialkeimasi committed Sep 2, 2023
1 parent dbc7269 commit ca0617d
Showing 1 changed file with 1 addition and 46 deletions.
47 changes: 1 addition & 46 deletions django_nextjs/render.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import warnings
from http.cookies import Morsel
from typing import Dict, Tuple, Union
from urllib.parse import quote

import aiohttp
from asgiref.sync import async_to_sync, sync_to_async
from asgiref.sync import sync_to_async
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import get_token as get_csrf_token
Expand Down Expand Up @@ -193,47 +192,3 @@ async def render_nextjs_page(
headers=headers,
)
return HttpResponse(content=content, status=status, headers=response_headers)


async def render_nextjs_page_to_string_async(*args, **kwargs):
warnings.warn(
(
"render_nextjs_page_to_string_async is deprecated and will be removed in a future release. "
"Use render_nextjs_page_to_string instead."
),
DeprecationWarning,
)
return await render_nextjs_page_to_string(*args, **kwargs)


async def render_nextjs_page_async(*args, **kwargs):
warnings.warn(
(
"render_nextjs_page_async is deprecated and will be removed in a future release. "
"Use render_nextjs_page instead."
),
DeprecationWarning,
)
return await render_nextjs_page(*args, **kwargs)


def render_nextjs_page_to_string_sync(*args, **kwargs):
warnings.warn(
(
"render_nextjs_page_to_string_sync is deprecated and will be removed in a future release. "
"Use render_nextjs_page_to_string in an async view, or use async_to_sync(render_nextjs_page_to_string)."
),
DeprecationWarning,
)
return async_to_sync(render_nextjs_page_to_string)(*args, **kwargs)


def render_nextjs_page_sync(*args, **kwargs):
warnings.warn(
(
"render_nextjs_page_sync is deprecated and will be removed in a future release. "
"Use render_nextjs_page in an async view, or use async_to_sync(render_nextjs_page)."
),
DeprecationWarning,
)
return async_to_sync(render_nextjs_page)(*args, **kwargs)

0 comments on commit ca0617d

Please sign in to comment.