From 0c4109f236f4963ffc8533a9d70f70f63c19dcb2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 4 Oct 2018 22:37:56 +0200 Subject: Remove CSRF check disabling --- example_project/settings.py | 8 -------- ishtar_common/middleware.py | 8 -------- 2 files changed, 16 deletions(-) delete mode 100644 ishtar_common/middleware.py diff --git a/example_project/settings.py b/example_project/settings.py index 02d62ffd9..a76134746 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -261,19 +261,11 @@ DOT_BINARY = "" TEST_RUNNER = 'ishtar_common.tests.ManagedModelTestRunner' -DISABLE_CSRF_CHECK = False # for testing purpose - try: from local_settings import * except ImportError, e: print('Unable to load local_settings.py:', e) -if DISABLE_CSRF_CHECK: - MIDDLEWARE.insert( - MIDDLEWARE.index('django.middleware.csrf.CsrfViewMiddleware'), - 'ishtar_common.middleware.DisableCsrfCheck' - ) - TABLE_COLS = {} # allow to overload table col settings on extra module COL_LABELS = {} diff --git a/ishtar_common/middleware.py b/ishtar_common/middleware.py deleted file mode 100644 index 0c7dea825..000000000 --- a/ishtar_common/middleware.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.utils.deprecation import MiddlewareMixin - - -class DisableCsrfCheck(MiddlewareMixin): - def process_request(self, req): - attr = '_dont_enforce_csrf_checks' - if not getattr(req, attr, False): - setattr(req, attr, True) -- cgit v1.2.3