From 23a056964712f24ff833efdd994419d6402fed6e Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 24 Apr 2024 11:44:22 +0100 Subject: [PATCH] build: Enable atomic transactions --- example_project/settings.py | 1 + example_project/test_settings.py | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/example_project/settings.py b/example_project/settings.py index 6195c1359..0b55848a3 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -23,6 +23,7 @@ # 'sqlite3' or 'oracle'. "NAME": os.path.join(os.path.abspath(os.path.dirname(__file__)), "db.sqlite3"), # Or path to database file if using sqlite3. + "ATOMIC_REQUESTS": True, } } diff --git a/example_project/test_settings.py b/example_project/test_settings.py index 3c218b405..320d75098 100644 --- a/example_project/test_settings.py +++ b/example_project/test_settings.py @@ -2,7 +2,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__)) -DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}} +DATABASES = { + "default": {"ENGINE": "django.db.backends.sqlite3", "ATOMIC_REQUESTS": True} +} TEMPLATES = [ { @@ -80,11 +82,17 @@ "output_filename": "portal.css", }, "popup": { - "source_filenames": (os.path.join(BASE_DIR, "static/portal/sass/partials/_popup.scss"),), + "source_filenames": ( + os.path.join( + BASE_DIR, "static/portal/sass/partials/_popup.scss" + ), + ), "output_filename": "popup.css", }, "game-scss": { - "source_filenames": (os.path.join(BASE_DIR, "static/game/sass/game.scss"),), + "source_filenames": ( + os.path.join(BASE_DIR, "static/game/sass/game.scss"), + ), "output_filename": "game.css", }, }, @@ -98,7 +106,10 @@ ] STATICFILES_STORAGE = "pipeline.storage.PipelineStorage" -GAME_SERVER_URL_FUNCTION = lambda game_id: ("base %s" % game_id, "path %s" % game_id) +GAME_SERVER_URL_FUNCTION = lambda game_id: ( + "base %s" % game_id, + "path %s" % game_id, +) GAME_SERVER_PORT_FUNCTION = lambda game_id: 8001 GAME_SERVER_SSL_FLAG = False