From 01e4bdad76b91b34e6f6744a28764eb1c74120de Mon Sep 17 00:00:00 2001 From: lxf Date: Sat, 14 May 2022 20:29:38 -0400 Subject: updated to support django 4.0 --- app/lib/django_comments/views/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/lib/django_comments/views') diff --git a/app/lib/django_comments/views/utils.py b/app/lib/django_comments/views/utils.py index a5f5c11..793fc43 100644 --- a/app/lib/django_comments/views/utils.py +++ b/app/lib/django_comments/views/utils.py @@ -12,7 +12,7 @@ except ImportError: # Python 2 from django.http import HttpResponseRedirect from django.shortcuts import render, resolve_url from django.core.exceptions import ObjectDoesNotExist -from django.utils.http import is_safe_url +from django.utils.http import url_has_allowed_host_and_scheme import django_comments @@ -28,7 +28,7 @@ def next_redirect(request, fallback, **get_kwargs): Returns an ``HttpResponseRedirect``. """ next = request.POST.get('next') - if not is_safe_url(url=next, allowed_hosts={request.get_host()}): + if not url_has_allowed_host_and_scheme(url=next, allowed_hosts={request.get_host()}): next = resolve_url(fallback) if get_kwargs: -- cgit v1.2.3-70-g09d2