Merge "Drop logic for django < 4.0"

This commit is contained in:
Zuul 2024-02-07 17:21:41 +00:00 committed by Gerrit Code Review
commit 7af2dc32d8

View File

@ -14,7 +14,6 @@ import datetime
import functools
import logging
import django
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.decorators import login_required
@ -43,7 +42,6 @@ from openstack_auth import utils
LOG = logging.getLogger(__name__)
if django.VERSION >= (4, 0):
CSRF_REASONS = [
csrf.REASON_BAD_ORIGIN,
csrf.REASON_NO_REFERER,
@ -53,15 +51,6 @@ if django.VERSION >= (4, 0):
csrf.REASON_MALFORMED_REFERER,
csrf.REASON_INSECURE_REFERER,
]
else:
CSRF_REASONS = [
csrf.REASON_NO_REFERER,
csrf.REASON_BAD_REFERER,
csrf.REASON_NO_CSRF_COOKIE,
csrf.REASON_BAD_TOKEN,
csrf.REASON_MALFORMED_REFERER,
csrf.REASON_INSECURE_REFERER
]
def get_csrf_reason(reason):