diff options
author | lxf <sng@luxagraf.net> | 2022-05-14 20:29:38 -0400 |
---|---|---|
committer | lxf <sng@luxagraf.net> | 2022-05-14 20:29:38 -0400 |
commit | 01e4bdad76b91b34e6f6744a28764eb1c74120de (patch) | |
tree | 5a5fd3059bb6ed5bef574257bdb7d766559b7aaf /app/lib/django_comments/views/utils.py | |
parent | bb3973ffb714c932e9ec6dd6a751228dc71fe1d3 (diff) |
updated to support django 4.0
Diffstat (limited to 'app/lib/django_comments/views/utils.py')
-rw-r--r-- | app/lib/django_comments/views/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
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: |