Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Upgrade Django to 4.2 (#15633)

Przemysław Łada9c296e50b6ca
diff --git a/poetry.lock b/poetry.lock
index 56c866cd55..366e52ddb3 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1088,20 +1088,20 @@ files = [
[[package]]
name = "django"
-version = "3.2.25"
-description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design."
+version = "4.2.15"
+description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design."
optional = false
-python-versions = ">=3.6"
+python-versions = ">=3.8"
files = [
- {file = "Django-3.2.25-py3-none-any.whl", hash = "sha256:a52ea7fcf280b16f7b739cec38fa6d3f8953a5456986944c3ca97e79882b4e38"},
- {file = "Django-3.2.25.tar.gz", hash = "sha256:7ca38a78654aee72378594d63e51636c04b8e28574f5505dff630895b5472777"},
+ {file = "Django-4.2.15-py3-none-any.whl", hash = "sha256:61ee4a130efb8c451ef3467c67ca99fdce400fedd768634efc86a68c18d80d30"},
+ {file = "Django-4.2.15.tar.gz", hash = "sha256:c77f926b81129493961e19c0e02188f8d07c112a1162df69bfab178ae447f94a"},
]
[package.dependencies]
-asgiref = ">=3.3.2,<4"
+asgiref = ">=3.6.0,<4"
bcrypt = {version = "*", optional = true, markers = "extra == \"bcrypt\""}
-pytz = "*"
-sqlparse = ">=0.2.2"
+sqlparse = ">=0.3.1"
+tzdata = {version = "*", markers = "sys_platform == \"win32\""}
[package.extras]
argon2 = ["argon2-cffi (>=19.1.0)"]
@@ -1328,24 +1328,6 @@ Django = ">=3.0,<5"
enmerkar = ">=0.7.1"
prices = ">=1.0.0"
-[[package]]
-name = "django-redis"
-version = "5.4.0"
-description = "Full featured redis cache backend for Django."
-optional = false
-python-versions = ">=3.6"
-files = [
- {file = "django-redis-5.4.0.tar.gz", hash = "sha256:6a02abaa34b0fea8bf9b707d2c363ab6adc7409950b2db93602e6cb292818c42"},
- {file = "django_redis-5.4.0-py3-none-any.whl", hash = "sha256:ebc88df7da810732e2af9987f7f426c96204bf89319df4c6da6ca9a2942edd5b"},
-]
-
-[package.dependencies]
-Django = ">=3.2"
-redis = ">=3,<4.0.0 || >4.0.0,<4.0.1 || >4.0.1"
-
-[package.extras]
-hiredis = ["redis[hiredis] (>=3,!=4.0.0,!=4.0.1)"]
-
[[package]]
name = "django-storages"
version = "1.14.4"
@@ -3330,23 +3312,89 @@ files = [
]
[[package]]
-name = "psycopg2"
-version = "2.9.9"
-description = "psycopg2 - Python-PostgreSQL Database Adapter"
+name = "psycopg"
+version = "3.2.1"
+description = "PostgreSQL database adapter for Python"
optional = false
-python-versions = ">=3.7"
+python-versions = ">=3.8"
+files = [
+ {file = "psycopg-3.2.1-py3-none-any.whl", hash = "sha256:ece385fb413a37db332f97c49208b36cf030ff02b199d7635ed2fbd378724175"},
+ {file = "psycopg-3.2.1.tar.gz", hash = "sha256:dc8da6dc8729dacacda3cc2f17d2c9397a70a66cf0d2b69c91065d60d5f00cb7"},
+]
+
+[package.dependencies]
+psycopg-binary = {version = "3.2.1", optional = true, markers = "implementation_name != \"pypy\" and extra == \"binary\""}
+typing-extensions = ">=4.4"
+tzdata = {version = "*", markers = "sys_platform == \"win32\""}
+
+[package.extras]
+binary = ["psycopg-binary (==3.2.1)"]
+c = ["psycopg-c (==3.2.1)"]
+dev = ["ast-comments (>=1.1.2)", "black (>=24.1.0)", "codespell (>=2.2)", "dnspython (>=2.1)", "flake8 (>=4.0)", "mypy (>=1.6)", "types-setuptools (>=57.4)", "wheel (>=0.37)"]
+docs = ["Sphinx (>=5.0)", "furo (==2022.6.21)", "sphinx-autobuild (>=2021.3.14)", "sphinx-autodoc-typehints (>=1.12)"]
+pool = ["psycopg-pool"]
+test = ["anyio (>=4.0)", "mypy (>=1.6)", "pproxy (>=2.7)", "pytest (>=6.2.5)", "pytest-cov (>=3.0)", "pytest-randomly (>=3.5)"]
+
+[[package]]
+name = "psycopg-binary"
+version = "3.2.1"
+description = "PostgreSQL database adapter for Python -- C optimisation distribution"
+optional = false
+python-versions = ">=3.8"
files = [
- {file = "psycopg2-2.9.9-cp310-cp310-win32.whl", hash = "sha256:38a8dcc6856f569068b47de286b472b7c473ac7977243593a288ebce0dc89516"},
- {file = "psycopg2-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:426f9f29bde126913a20a96ff8ce7d73fd8a216cfb323b1f04da402d452853c3"},
- {file = "psycopg2-2.9.9-cp311-cp311-win32.whl", hash = "sha256:ade01303ccf7ae12c356a5e10911c9e1c51136003a9a1d92f7aa9d010fb98372"},
- {file = "psycopg2-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:121081ea2e76729acfb0673ff33755e8703d45e926e416cb59bae3a86c6a4981"},
- {file = "psycopg2-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:5e0d98cade4f0e0304d7d6f25bbfbc5bd186e07b38eac65379309c4ca3193efa"},
- {file = "psycopg2-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:7e2dacf8b009a1c1e843b5213a87f7c544b2b042476ed7755be813eaf4e8347a"},
- {file = "psycopg2-2.9.9-cp38-cp38-win32.whl", hash = "sha256:ff432630e510709564c01dafdbe996cb552e0b9f3f065eb89bdce5bd31fabf4c"},
- {file = "psycopg2-2.9.9-cp38-cp38-win_amd64.whl", hash = "sha256:bac58c024c9922c23550af2a581998624d6e02350f4ae9c5f0bc642c633a2d5e"},
- {file = "psycopg2-2.9.9-cp39-cp39-win32.whl", hash = "sha256:c92811b2d4c9b6ea0285942b2e7cac98a59e166d59c588fe5cfe1eda58e72d59"},
- {file = "psycopg2-2.9.9-cp39-cp39-win_amd64.whl", hash = "sha256:de80739447af31525feddeb8effd640782cf5998e1a4e9192ebdf829717e3913"},
- {file = "psycopg2-2.9.9.tar.gz", hash = "sha256:d1454bde93fb1e224166811694d600e746430c006fbb031ea06ecc2ea41bf156"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:cad2de17804c4cfee8640ae2b279d616bb9e4734ac3c17c13db5e40982bd710d"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:592b27d6c46a40f9eeaaeea7c1fef6f3c60b02c634365eb649b2d880669f149f"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9a997efbaadb5e1a294fb5760e2f5643d7b8e4e3fe6cb6f09e6d605fd28e0291"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1d2b6438fb83376f43ebb798bf0ad5e57bc56c03c9c29c85bc15405c8c0ac5a"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b1f087bd84bdcac78bf9f024ebdbfacd07fc0a23ec8191448a50679e2ac4a19e"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:415c3b72ea32119163255c6504085f374e47ae7345f14bc3f0ef1f6e0976a879"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f092114f10f81fb6bae544a0ec027eb720e2d9c74a4fcdaa9dd3899873136935"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:06a7aae34edfe179ddc04da005e083ff6c6b0020000399a2cbf0a7121a8a22ea"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0b018631e5c80ce9bc210b71ea885932f9cca6db131e4df505653d7e3873a938"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f8a509aeaac364fa965454e80cd110fe6d48ba2c80f56c9b8563423f0b5c3cfd"},
+ {file = "psycopg_binary-3.2.1-cp310-cp310-win_amd64.whl", hash = "sha256:413977d18412ff83486eeb5875eb00b185a9391c57febac45b8993bf9c0ff489"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:62b1b7b07e00ee490afb39c0a47d8282a9c2822c7cfed9553a04b0058adf7e7f"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f8afb07114ea9b924a4a0305ceb15354ccf0ef3c0e14d54b8dbeb03e50182dd7"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40bb515d042f6a345714ec0403df68ccf13f73b05e567837d80c886c7c9d3805"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6418712ba63cebb0c88c050b3997185b0ef54173b36568522d5634ac06153040"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:101472468d59c74bb8565fab603e032803fd533d16be4b2d13da1bab8deb32a3"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa3931f308ab4a479d0ee22dc04bea867a6365cac0172e5ddcba359da043854b"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:dc314a47d44fe1a8069b075a64abffad347a3a1d8652fed1bab5d3baea37acb2"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:cc304a46be1e291031148d9d95c12451ffe783ff0cc72f18e2cc7ec43cdb8c68"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:6f9e13600647087df5928875559f0eb8f496f53e6278b7da9511b4b3d0aff960"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b140182830c76c74d17eba27df3755a46442ce8d4fb299e7f1cf2f74a87c877b"},
+ {file = "psycopg_binary-3.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:3c838806eeb99af39f934b7999e35f947a8e577997cc892c12b5053a97a9057f"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:7066d3dca196ed0dc6172f9777b2d62e4f138705886be656cccff2d555234d60"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:28ada5f610468c57d8a4a055a8ea915d0085a43d794266c4f3b9d02f4288f4db"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e8213bf50af073b1aa8dc3cff123bfeedac86332a16c1b7274910bc88a847c7"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:74d623261655a169bc84a9669890975c229f2fa6e19a7f2d10a77675dcf1a707"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:42781ba94e8842ee98bca5a7d0c44cc9d067500fedca2d6a90fa3609b6d16b42"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33e6669091d09f8ba36e10ce678a6d9916e110446236a9b92346464a3565635e"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b09e8a576a2ac69d695032ee76f31e03b30781828b5dd6d18c6a009e5a3d1c35"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:8f28ff0cb9f1defdc4a6f8c958bf6787274247e7dfeca811f6e2f56602695fb1"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4c84fcac8a3a3479ac14673095cc4e1fdba2935499f72c436785ac679bec0d1a"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:950fd666ec9e9fe6a8eeb2b5a8f17301790e518953730ad44d715b59ffdbc67f"},
+ {file = "psycopg_binary-3.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:334046a937bb086c36e2c6889fe327f9f29bfc085d678f70fac0b0618949f674"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:1d6833f607f3fc7b22226a9e121235d3b84c0eda1d3caab174673ef698f63788"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d353e028b8f848b9784450fc2abf149d53a738d451eab3ee4c85703438128b9"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f34e369891f77d0738e5d25727c307d06d5344948771e5379ea29c76c6d84555"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ab58213cc976a1666f66bc1cb2e602315cd753b7981a8e17237ac2a185bd4a1"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0104a72a17aa84b3b7dcab6c84826c595355bf54bb6ea6d284dcb06d99c6801"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:059cbd4e6da2337e17707178fe49464ed01de867dc86c677b30751755ec1dc51"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:73f9c9b984be9c322b5ec1515b12df1ee5896029f5e72d46160eb6517438659c"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:af0469c00f24c4bec18c3d2ede124bf62688d88d1b8a5f3c3edc2f61046fe0d7"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:463d55345f73ff391df8177a185ad57b552915ad33f5cc2b31b930500c068b22"},
+ {file = "psycopg_binary-3.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:302b86f92c0d76e99fe1b5c22c492ae519ce8b98b88d37ef74fda4c9e24c6b46"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:0879b5d76b7d48678d31278242aaf951bc2d69ca4e4d7cef117e4bbf7bfefda9"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f99e59f8a5f4dcd9cbdec445f3d8ac950a492fc0e211032384d6992ed3c17eb7"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84837e99353d16c6980603b362d0f03302d4b06c71672a6651f38df8a482923d"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ce965caf618061817f66c0906f0452aef966c293ae0933d4fa5a16ea6eaf5bb"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78c2007caf3c90f08685c5378e3ceb142bafd5636be7495f7d86ec8a977eaeef"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7a84b5eb194a258116154b2a4ff2962ea60ea52de089508db23a51d3d6b1c7d1"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4a42b8f9ab39affcd5249b45cac763ac3cf12df962b67e23fd15a2ee2932afe5"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:788ffc43d7517c13e624c83e0e553b7b8823c9655e18296566d36a829bfb373f"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:21927f41c4d722ae8eb30d62a6ce732c398eac230509af5ba1749a337f8a63e2"},
+ {file = "psycopg_binary-3.2.1-cp39-cp39-win_amd64.whl", hash = "sha256:921f0c7f39590763d64a619de84d1b142587acc70fd11cbb5ba8fa39786f3073"},
]
[[package]]
@@ -3821,7 +3869,6 @@ files = [
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"},
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"},
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"},
- {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"},
{file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"},
{file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"},
{file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"},
@@ -3829,15 +3876,8 @@ files = [
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"},
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"},
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"},
- {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"},
{file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"},
{file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"},
- {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"},
- {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"},
- {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"},
- {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"},
- {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"},
- {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"},
{file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"},
{file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"},
{file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"},
@@ -3854,7 +3894,6 @@ files = [
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"},
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"},
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"},
- {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"},
{file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"},
{file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"},
{file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"},
@@ -3862,7 +3901,6 @@ files = [
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"},
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"},
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"},
- {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"},
{file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"},
{file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"},
{file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"},
@@ -4119,24 +4157,24 @@ python-versions = ">=3.6"
files = [
{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b42169467c42b692c19cf539c38d4602069d8c1505e97b86387fcf7afb766e1d"},
{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_13_0_arm64.whl", hash = "sha256:07238db9cbdf8fc1e9de2489a4f68474e70dffcb32232db7c08fa61ca0c7c462"},
- {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:d92f81886165cb14d7b067ef37e142256f1c6a90a65cd156b063a43da1708cfd"},
{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fff3573c2db359f091e1589c3d7c5fc2f86f5bdb6f24252c2d8e539d4e45f412"},
+ {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:aa2267c6a303eb483de8d02db2871afb5c5fc15618d894300b88958f729ad74f"},
{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:840f0c7f194986a63d2c2465ca63af8ccbbc90ab1c6001b1978f05119b5e7334"},
{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:024cfe1fc7c7f4e1aff4a81e718109e13409767e4f871443cbff3dba3578203d"},
{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win32.whl", hash = "sha256:c69212f63169ec1cfc9bb44723bf2917cbbd8f6191a00ef3410f5a7fe300722d"},
{file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win_amd64.whl", hash = "sha256:cabddb8d8ead485e255fe80429f833172b4cadf99274db39abc080e068cbcc31"},
{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bef08cd86169d9eafb3ccb0a39edb11d8e25f3dae2b28f5c52fd997521133069"},
{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:b16420e621d26fdfa949a8b4b47ade8810c56002f5389970db4ddda51dbff248"},
- {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:b5edda50e5e9e15e54a6a8a0070302b00c518a9d32accc2346ad6c984aacd279"},
{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:25c515e350e5b739842fc3228d662413ef28f295791af5e5110b543cf0b57d9b"},
+ {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_24_aarch64.whl", hash = "sha256:1707814f0d9791df063f8c19bb51b0d1278b8e9a2353abbb676c2f685dee6afe"},
{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:46d378daaac94f454b3a0e3d8d78cafd78a026b1d71443f4966c696b48a6d899"},
{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:09b055c05697b38ecacb7ac50bdab2240bfca1a0c4872b0fd309bb07dc9aa3a9"},
{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win32.whl", hash = "sha256:53a300ed9cea38cf5a2a9b069058137c2ca1ce658a874b79baceb8f892f915a7"},
{file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win_amd64.whl", hash = "sha256:c2a72e9109ea74e511e29032f3b670835f8a59bbdc9ce692c5b4ed91ccf1eedb"},
{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ebc06178e8821efc9692ea7544aa5644217358490145629914d8020042c24aa1"},
{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:edaef1c1200c4b4cb914583150dcaa3bc30e592e907c01117c08b13a07255ec2"},
- {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:7048c338b6c86627afb27faecf418768acb6331fc24cfa56c93e8c9780f815fa"},
{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d176b57452ab5b7028ac47e7b3cf644bcfdc8cacfecf7e71759f7f51a59e5c92"},
+ {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_24_aarch64.whl", hash = "sha256:1dc67314e7e1086c9fdf2680b7b6c2be1c0d8e3a8279f2e993ca2a7545fecf62"},
{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3213ece08ea033eb159ac52ae052a4899b56ecc124bb80020d9bbceeb50258e9"},
{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aab7fd643f71d7946f2ee58cc88c9b7bfc97debd71dcc93e03e2d174628e7e2d"},
{file = "ruamel.yaml.clib-0.2.8-cp312-cp312-win32.whl", hash = "sha256:5c365d91c88390c8d0a8545df0b5857172824b1c604e867161e6b3d59a827eaa"},
@@ -4144,7 +4182,7 @@ files = [
{file = "ruamel.yaml.clib-0.2.8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a5aa27bad2bb83670b71683aae140a1f52b0857a2deff56ad3f6c13a017a26ed"},
{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c58ecd827313af6864893e7af0a3bb85fd529f862b6adbefe14643947cfe2942"},
{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f481f16baec5290e45aebdc2a5168ebc6d35189ae6fea7a58787613a25f6e875"},
- {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:3fcc54cb0c8b811ff66082de1680b4b14cf8a81dce0d4fbf665c2265a81e07a1"},
+ {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:77159f5d5b5c14f7c34073862a6b7d34944075d9f93e681638f6d753606c6ce6"},
{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7f67a1ee819dc4562d444bbafb135832b0b909f81cc90f7aa00260968c9ca1b3"},
{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4ecbf9c3e19f9562c7fdd462e8d18dd902a47ca046a2e64dba80699f0b6c09b7"},
{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:87ea5ff66d8064301a154b3933ae406b0863402a799b16e4a1d24d9fbbcbe0d3"},
@@ -4152,7 +4190,7 @@ files = [
{file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-win_amd64.whl", hash = "sha256:3f215c5daf6a9d7bbed4a0a4f760f3113b10e82ff4c5c44bec20a68c8014f675"},
{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1b617618914cb00bf5c34d4357c37aa15183fa229b24767259657746c9077615"},
{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:a6a9ffd280b71ad062eae53ac1659ad86a17f59a0fdc7699fd9be40525153337"},
- {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:665f58bfd29b167039f714c6998178d27ccd83984084c286110ef26b230f259f"},
+ {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:305889baa4043a09e5b76f8e2a51d4ffba44259f6b4c72dec8ca56207d9c6fe1"},
{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:700e4ebb569e59e16a976857c8798aee258dceac7c7d6b50cab63e080058df91"},
{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e2b4c44b60eadec492926a7270abb100ef9f72798e18743939bdbf037aab8c28"},
{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e79e5db08739731b0ce4850bed599235d601701d5694c36570a99a0c5ca41a9d"},
@@ -4160,7 +4198,7 @@ files = [
{file = "ruamel.yaml.clib-0.2.8-cp38-cp38-win_amd64.whl", hash = "sha256:56f4252222c067b4ce51ae12cbac231bce32aee1d33fbfc9d17e5b8d6966c312"},
{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03d1162b6d1df1caa3a4bd27aa51ce17c9afc2046c31b0ad60a0a96ec22f8001"},
{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:bba64af9fa9cebe325a62fa398760f5c7206b215201b0ec825005f1b18b9bccf"},
- {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:9eb5dee2772b0f704ca2e45b1713e4e5198c18f515b52743576d196348f374d3"},
+ {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:a1a45e0bb052edf6a1d3a93baef85319733a888363938e1fc9924cb00c8df24c"},
{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:da09ad1c359a728e112d60116f626cc9f29730ff3e0e7db72b9a2dbc2e4beed5"},
{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:184565012b60405d93838167f425713180b949e9d8dd0bbc7b49f074407c5a8b"},
{file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a75879bacf2c987c003368cf14bed0ffe99e8e85acfa6c0bfffc21a090f16880"},
@@ -4877,7 +4915,6 @@ description = "Automatically mock your HTTP interactions to simplify and speed u
optional = false
python-versions = ">=3.8"
files = [
- {file = "vcrpy-6.0.1-py2.py3-none-any.whl", hash = "sha256:621c3fb2d6bd8aa9f87532c688e4575bcbbde0c0afeb5ebdb7e14cac409edfdd"},
{file = "vcrpy-6.0.1.tar.gz", hash = "sha256:9e023fee7f892baa0bbda2f7da7c8ac51165c1c6e38ff8688683a12a4bde9278"},
]
@@ -5423,4 +5460,4 @@ test = ["pytest"]
[metadata]
lock-version = "2.0"
python-versions = "~3.9"
-content-hash = "4d1990d66939f3bfb2f2bcaf492a531505efc34d309b40f4094494ce2bfd9e19"
+content-hash = "3775c4b3579e20a8e512f7cc59e0dcfc0b04a125ac3636f6685cdb30321825ec"
diff --git a/pyproject.toml b/pyproject.toml
index e33270c4ed..96720688f3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,7 +30,7 @@ documentation = "https://docs.saleor.io/"
cryptography = "^42.0.5"
dj-database-url = "^2"
dj-email-url = "^1"
- django = {version = "^3.2.24", extras = ["bcrypt"]}
+ django = {version = "^4.2", extras = ["bcrypt"]}
django-cache-url = "^3.1.2"
django-celery-beat = "^2.2.1"
django-countries = "^7.2"
@@ -39,7 +39,6 @@ documentation = "https://docs.saleor.io/"
django-mptt = "^0"
django-phonenumber-field = ">=4,<8"
django-prices = "^2.3"
- django-redis = "^5.0.0"
django-stubs-ext = "^4.2.1"
draftjs-sanitizer = "^1.0.0"
faker = ">=26.0.0,<27.0"
@@ -66,7 +65,6 @@ documentation = "https://docs.saleor.io/"
posuto = "^2024.7.0"
prices = "^1.0"
promise = "^2.3"
- psycopg2 = "^2.8.3"
pybars3 = "^0.9.7"
pyjwt = "2.5.0" # Version 2.6.0 changed iat validation which causes tests to fail: https://github.com/saleor/saleor/issues/11047
python-dateutil = "^2.8.2"
@@ -88,6 +86,7 @@ documentation = "https://docs.saleor.io/"
uvicorn = {extras = ["standard"], version = "^0.23.1"}
weasyprint = ">=53.0" # libpango >=1.44 is required
setuptools = "^70.1.0"
+ psycopg = {version = "^3.1.8", extras = ["binary"]}
[tool.poetry.dependencies.celery]
version = ">=4.4.5,<6.0.0"
@@ -154,7 +153,7 @@ extend_exclude = ["conftest\\.py", ".*/conftest\\.py", ".*/tests/.*"]
[tool.deptry.per_rule_ignores]
DEP001 = ["pkg_resources"]
- DEP002 = ["azure-common", "azure-storage-blob", "azure-storage-common", "django-redis", "gunicorn", "psycopg2"]
+ DEP002 = ["azure-common", "azure-storage-blob", "azure-storage-common", "gunicorn", "psycopg"]
DEP004 = ["debug_toolbar", "graphiql_debug_toolbar"]
[tool.ruff]
diff --git a/saleor/account/__init__.py b/saleor/account/__init__.py
index 7b702e499f..aacc063e85 100755
--- a/saleor/account/__init__.py
+++ b/saleor/account/__init__.py
@@ -1,6 +1,3 @@
-default_app_config = "saleor.account.app.AccountAppConfig"
-
-
class CustomerEvents:
"""The different customer event types."""
diff --git a/saleor/account/app.py b/saleor/account/apps.py
similarity index 100%
rename from saleor/account/app.py
rename to saleor/account/apps.py
diff --git a/saleor/app/__init__.py b/saleor/app/__init__.py
index 1f36c81d53..e69de29bb2 100644
--- a/saleor/app/__init__.py
+++ b/saleor/app/__init__.py
@@ -1 +0,0 @@
-default_app_config = "saleor.app.app.AppConfig"
diff --git a/saleor/core/__init__.py b/saleor/core/__init__.py
index 02eef0e34f..282dcb4e68 100644
--- a/saleor/core/__init__.py
+++ b/saleor/core/__init__.py
@@ -1,6 +1,3 @@
-default_app_config = "saleor.core.app.CoreAppConfig"
-
-
class JobStatus:
PENDING = "pending"
SUCCESS = "success"
diff --git a/saleor/core/app.py b/saleor/core/apps.py
similarity index 82%
rename from saleor/core/app.py
rename to saleor/core/apps.py
index 7bfd219076..7dbf39ebe3 100644
--- a/saleor/core/app.py
+++ b/saleor/core/apps.py
@@ -2,7 +2,7 @@ from typing import Callable, Optional
from django.apps import AppConfig
from django.conf import settings
-from django.db.models import Field
+from django.db.models import CharField, TextField
from django.utils.module_loading import import_string
from .db.filters import PostgresILike
@@ -11,14 +11,14 @@ from .db.filters import PostgresILike
class CoreAppConfig(AppConfig):
name = "saleor.core"
- def ready(self):
- Field.register_lookup(PostgresILike)
-
+ def ready(self) -> None:
+ CharField.register_lookup(PostgresILike)
+ TextField.register_lookup(PostgresILike)
if settings.SENTRY_DSN:
settings.SENTRY_INIT(settings.SENTRY_DSN, settings.SENTRY_OPTS)
self.validate_jwt_manager()
- def validate_jwt_manager(self):
+ def validate_jwt_manager(self) -> None:
jwt_manager_path = getattr(settings, "JWT_MANAGER_PATH", None)
if not jwt_manager_path:
raise ImportError(
diff --git a/saleor/core/db/fields.py b/saleor/core/db/fields.py
index 8a7f185654..4229771d2d 100644
--- a/saleor/core/db/fields.py
+++ b/saleor/core/db/fields.py
@@ -2,6 +2,7 @@ import json
from typing import Callable
from django.db.models import JSONField
+from django.db.models.expressions import Expression
class SanitizedJSONField(JSONField):
@@ -19,4 +20,6 @@ class SanitizedJSONField(JSONField):
def get_db_prep_save(self, value: dict, connection):
"""Sanitize the value for saving using the passed sanitizer."""
+ if isinstance(value, Expression):
+ return value
return json.dumps(self._sanitizer_method(value))
diff --git a/saleor/discount/migrations/0075_promotionrule_gifts.py b/saleor/discount/migrations/0075_promotionrule_gifts.py
index 427d4a5005..c86c2e0744 100644
--- a/saleor/discount/migrations/0075_promotionrule_gifts.py
+++ b/saleor/discount/migrations/0075_promotionrule_gifts.py
@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
name="gifts",
field=models.ManyToManyField(
blank=True,
- related_name="_discount_promotionrule_gifts_+",
+ related_name="+",
to="product.ProductVariant",
),
),
diff --git a/saleor/graphql/attribute/mutations/mixins.py b/saleor/graphql/attribute/mutations/mixins.py
index 1bb28c3191..e2acfbacd4 100644
--- a/saleor/graphql/attribute/mutations/mixins.py
+++ b/saleor/graphql/attribute/mutations/mixins.py
@@ -45,7 +45,9 @@ class AttributeMixin:
is_swatch_attr = attribute_input_type == AttributeInputType.SWATCH
- slug_list = list(attribute.values.values_list("slug", flat=True))
+ slug_list = list(
+ attribute.values.values_list("slug", flat=True) if attribute.pk else []
+ )
for value_data in values_input:
cls._validate_value(attribute, value_data, is_swatch_attr, slug_list)
@@ -122,7 +124,9 @@ class AttributeMixin:
@classmethod
def check_values_are_unique(cls, values_input: dict, attribute: models.Attribute):
# Check values uniqueness in case of creating new attribute.
- existing_names = attribute.values.values_list("name", flat=True)
+ existing_names = (
+ attribute.values.values_list("name", flat=True) if attribute.pk else []
+ )
existing_names = [name.lower().strip() for name in existing_names]
for value_data in values_input:
name = unidecode(value_data["name"]).lower().strip()
diff --git a/saleor/graphql/attribute/utils.py b/saleor/graphql/attribute/utils.py
index 69b6904a58..db7b06ae24 100644
--- a/saleor/graphql/attribute/utils.py
+++ b/saleor/graphql/attribute/utils.py
@@ -10,7 +10,6 @@ from django.core.exceptions import ValidationError
from django.db.models import Q
from django.db.models.expressions import Exists, OuterRef
from django.template.defaultfilters import truncatechars
-from django.utils import timezone
from django.utils.text import slugify
from graphql.error import GraphQLError
from text_unidecode import unidecode
@@ -685,7 +684,7 @@ class AttributeAssignmentMixin:
attr_values: AttrValuesInput,
):
is_date_attr = attribute.input_type == AttributeInputType.DATE
- tz = timezone.utc
+ tz = datetime.timezone.utc
if is_date_attr:
if not attr_values.date:
return ()
diff --git a/saleor/graphql/core/tests/test_core_reordering.py b/saleor/graphql/core/tests/test_core_reordering.py
index d28cfcdc35..be0046ed7f 100644
--- a/saleor/graphql/core/tests/test_core_reordering.py
+++ b/saleor/graphql/core/tests/test_core_reordering.py
@@ -235,9 +235,9 @@ def test_reordering_concurrently(dummy_attribute, assert_num_queries):
assert ctx[1]["sql"] == (
'UPDATE "attribute_attributevalue" '
'SET "sort_order" = '
- f'CAST(CASE WHEN ("attribute_attributevalue"."id" = {entries[0].pk}) '
+ f'(CASE WHEN ("attribute_attributevalue"."id" = {entries[0].pk}) '
f'THEN 1 WHEN ("attribute_attributevalue"."id" = {entries[1].pk}) '
- "THEN 0 ELSE NULL END AS integer) "
+ "THEN 0 ELSE NULL END)::integer "
'WHERE "attribute_attributevalue"."id" '
f"IN ({entries[0].pk}, {entries[1].pk})"
)
@@ -266,8 +266,8 @@ def test_reordering_deleted_node_from_concurrent_update(
assert ctx[1]["sql"] == (
'UPDATE "attribute_attributevalue" '
'SET "sort_order" = '
- f'CAST(CASE WHEN ("attribute_attributevalue"."id" = {entries[0].pk}) '
+ f'(CASE WHEN ("attribute_attributevalue"."id" = {entries[0].pk}) '
f'THEN 1 WHEN ("attribute_attributevalue"."id" = {entries[1].pk}) '
- "THEN 0 ELSE NULL END AS integer) "
+ "THEN 0 ELSE NULL END)::integer "
f'WHERE "attribute_attributevalue"."id" IN ({entries[0].pk}, {entries[1].pk})'
)
diff --git a/saleor/graphql/core/utils/reordering.py b/saleor/graphql/core/utils/reordering.py
index a7d3a0e25a..ffb27fd0bb 100644
--- a/saleor/graphql/core/utils/reordering.py
+++ b/saleor/graphql/core/utils/reordering.py
@@ -12,12 +12,15 @@ __all__ = ["perform_reordering"]
class FinalSortOrder:
"""Describe a final sort order value for a given PK.
- This is needed to tell django which objects and values to associate and update.
+ This is a hack to tell Django which objects and values to associate and update.
"""
pk: int
sort_order: int
+ def _prepare_related_fields_for_save(self, operation_name, fields=None):
+ pass
+
class Reordering:
def __init__(self, qs: QuerySet, operations: dict[int, int], field: str):
diff --git a/saleor/graphql/views.py b/saleor/graphql/views.py
index b90ac6e71e..c29a250990 100644
--- a/saleor/graphql/views.py
+++ b/saleor/graphql/views.py
@@ -167,11 +167,11 @@ class GraphQLView(View):
opentracing.tags.HTTP_URL,
request.build_absolute_uri(request.get_full_path()),
)
- accepted_encoding = request.META.get("HTTP_ACCEPT_ENCODING", "")
+ accepted_encoding = request.headers.get("accept-encoding", "")
span.set_tag(
"http.compression", "gzip" if "gzip" in accepted_encoding else "none"
)
- span.set_tag("http.useragent", request.META.get("HTTP_USER_AGENT", ""))
+ span.set_tag("http.useragent", request.headers.get("user-agent", ""))
span.set_tag("span.type", "web")
main_ip_header = settings.REAL_IP_ENVIRON[0]
diff --git a/saleor/order/migrations/0172_update_order_cc_addresses.py b/saleor/order/migrations/0172_update_order_cc_addresses.py
index c686fdfd5f..9c1c8e6ed0 100644
--- a/saleor/order/migrations/0172_update_order_cc_addresses.py
+++ b/saleor/order/migrations/0172_update_order_cc_addresses.py
@@ -38,7 +38,7 @@ def update_order_addresses(apps, schema_editor):
order_address = Address(**model_to_dict(cc_address, exclude=["id"]))
order.shipping_address = order_address
addresses.append(order_address)
- Address.objects.bulk_create(addresses, ignore_conflicts=True)
+ Address.objects.bulk_create(addresses, ignore_conflicts=False)
Order.objects.bulk_update(orders, ["shipping_address"])
diff --git a/saleor/order/migrations/0181_order_subtotal_as_a_field.py b/saleor/order/migrations/0181_order_subtotal_as_a_field.py
index 7c7f7bae4d..f121afd839 100644
--- a/saleor/order/migrations/0181_order_subtotal_as_a_field.py
+++ b/saleor/order/migrations/0181_order_subtotal_as_a_field.py
@@ -31,13 +31,21 @@ def update_order_subtotals(apps, schema_editor):
break
order_line = OrderLine.objects.filter(order=OuterRef("pk"))
- subtotal_net_sum = order_line.annotate(
- net_sum=Func(F("total_price_net_amount"), function="Sum")
- ).values("net_sum")
+ subtotal_net_sum = (
+ order_line.annotate(
+ net_sum=Func(F("total_price_net_amount"), function="Sum")
+ )
+ .values("net_sum")
+ .order_by()
+ )
- subtotal_gross_sum = order_line.annotate(
- gross_sum=Func(F("total_price_gross_amount"), function="Sum")
- ).values("gross_sum")
+ subtotal_gross_sum = (
+ order_line.annotate(
+ gross_sum=Func(F("total_price_gross_amount"), function="Sum")
+ )
+ .values("gross_sum")
+ .order_by()
+ )
orders_with_totals = Order.objects.filter(
number__in=current_batch_order_numbers
diff --git a/saleor/order/tasks.py b/saleor/order/tasks.py
index bfe77b03fd..1130698558 100644
--- a/saleor/order/tasks.py
+++ b/saleor/order/tasks.py
@@ -67,9 +67,11 @@ def _bulk_release_voucher_usage(order_ids):
voucher_code=OuterRef("code"),
id__in=order_ids,
)
- count_orders = voucher_orders.annotate(
- count=Func(F("pk"), function="Count")
- ).values("count")
+ count_orders = (
+ voucher_orders.annotate(count=Func(F("pk"), function="Count"))
+ .values("count")
+ .order_by()
+ )
vouchers = Voucher.objects.filter(usage_limit__isnull=False)
codes = VoucherCode.objects.filter(
diff --git a/saleor/payment/gateways/stripe/webhooks.py b/saleor/payment/gateways/stripe/webhooks.py
index 7f5acb6938..bffef3e525 100644
--- a/saleor/payment/gateways/stripe/webhooks.py
+++ b/saleor/payment/gateways/stripe/webhooks.py
@@ -52,7 +52,7 @@ def handle_webhook(
request: WSGIRequest, gateway_config: "GatewayConfig", channel_slug: str
):
payload = request.body
- sig_header = request.META["HTTP_STRIPE_SIGNATURE"]
+ sig_header = request.headers["stripe-signature"]
api_key = gateway_config.connection_params["secret_api_key"]
endpoint_secret = gateway_config.connection_params.get("webhook_secret")
diff --git a/saleor/payment/migrations/0041_add_calculation_transaction_events.py b/saleor/payment/migrations/0041_add_calculation_transaction_events.py
index a7ed70727d..5d3de80f89 100644
--- a/saleor/payment/migrations/0041_add_calculation_transaction_events.py
+++ b/saleor/payment/migrations/0041_add_calculation_transaction_events.py
@@ -29,6 +29,7 @@ def _get_events(transaction_event, type):
)
.annotate(amount_sum=Func(F("amount_value"), function="Sum"))
.values("amount_sum")
+ .order_by()
)
@@ -72,17 +73,15 @@ def create_event_for_charged_task(transaction_item, transaction_event):
type = "charge_success"
events = _get_events(transaction_event, type)
qs = (
- (
- transaction_item.objects.filter(~Q(charged_value=Decimal(0)))
- .annotate(
- amount_sum_temp=Subquery(events),
- amount_sum=Case(
- When(amount_sum_temp__isnull=True, then=Decimal(0)),
- default=F("amount_sum_temp"),
- ),
- )
- .filter(charged_value__gt=F("amount_sum"))
+ transaction_item.objects.filter(~Q(charged_value=Decimal(0)))
+ .annotate(
+ amount_sum_temp=Subquery(events),
+ amount_sum=Case(
+ When(amount_sum_temp__isnull=True, then=Decimal(0)),
+ default=F("amount_sum_temp"),
+ ),
)
+ .filter(charged_value__gt=F("amount_sum"))
.order_by("-pk")
.values_list("id", "charged_value", "amount_sum", "currency")
)
@@ -94,17 +93,15 @@ def create_event_for_refunded_task(transaction_item, transaction_event):
type = "refund_success"
events = _get_events(transaction_event, type)
qs = (
- (
- transaction_item.objects.filter(~Q(refunded_value=Decimal(0)))
- .annotate(
- amount_sum_temp=Subquery(events),
- amount_sum=Case(
- When(amount_sum_temp__isnull=True, then=Decimal(0)),
- default=F("amount_sum_temp"),
- ),
- )
- .filter(refunded_value__gt=F("amount_sum"))
+ transaction_item.objects.filter(~Q(refunded_value=Decimal(0)))
+ .annotate(
+ amount_sum_temp=Subquery(events),
+ amount_sum=Case(
+ When(amount_sum_temp__isnull=True, then=Decimal(0)),
+ default=F("amount_sum_temp"),
+ ),
)
+ .filter(refunded_value__gt=F("amount_sum"))
.order_by("-pk")
.values_list("id", "refunded_value", "amount_sum", "currency")
)
@@ -117,17 +114,15 @@ def create_event_for_canceled_task(transaction_item, transaction_event):
events = _get_events(transaction_event, type)
# voided_value instead of canceled_value cause some data may not be migrated yet
qs = (
- (
- transaction_item.objects.filter(~Q(voided_value=Decimal(0)))
- .annotate(
- amount_sum_temp=Subquery(events),
- amount_sum=Case(
- When(amount_sum_temp__isnull=True, then=Decimal(0)),
- default=F("amount_sum_temp"),
- ),
- )
- .filter(voided_value__gt=F("amount_sum"))
+ transaction_item.objects.filter(~Q(voided_value=Decimal(0)))
+ .annotate(
+ amount_sum_temp=Subquery(events),
+ amount_sum=Case(
+ When(amount_sum_temp__isnull=True, then=Decimal(0)),
+ default=F("amount_sum_temp"),
+ ),
)
+ .filter(voided_value__gt=F("amount_sum"))
.order_by("-pk")
.values_list("id", "voided_value", "amount_sum", "currency")
)
diff --git a/saleor/plugins/__init__.py b/saleor/plugins/__init__.py
index 9bcefc170a..9f10463078 100644
--- a/saleor/plugins/__init__.py
+++ b/saleor/plugins/__init__.py
@@ -1,6 +1,5 @@
import importlib
-default_app_config = "saleor.plugins.apps.PluginConfig"
PLUGIN_IDENTIFIER_PREFIX = "plugin:"
diff --git a/saleor/product/__init__.py b/saleor/product/__init__.py
index 00411a63a5..e22574a377 100644
--- a/saleor/product/__init__.py
+++ b/saleor/product/__init__.py
@@ -1,6 +1,3 @@
-default_app_config = "saleor.product.app.ProductAppConfig"
-
-
class ProductMediaTypes:
IMAGE = "IMAGE"
VIDEO = "VIDEO"
diff --git a/saleor/product/app.py b/saleor/product/apps.py
similarity index 100%
rename from saleor/product/app.py
rename to saleor/product/apps.py
diff --git a/saleor/settings.py b/saleor/settings.py
index c2a329fe23..4b9dd4f3b0 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -92,7 +92,9 @@ INTERNAL_IPS = get_list(os.environ.get("INTERNAL_IPS", "127.0.0.1"))
# Maximum time in seconds Django can keep the database connections opened.
# Set the value to 0 to disable connection persistence, database connections
# will be closed after each request.
-DB_CONN_MAX_AGE = int(os.environ.get("DB_CONN_MAX_AGE", 600))
+# For Django 4, the default value was changed to 0 as persistent DB connections
+# are not supported.
+DB_CONN_MAX_AGE = int(os.environ.get("DB_CONN_MAX_AGE", 0))
DATABASE_CONNECTION_DEFAULT_NAME = "default"
# TODO: For local envs will be activated in separate PR.
@@ -124,7 +126,6 @@ LANGUAGE_CODE = "en"
LANGUAGES = CORE_LANGUAGES
LOCALE_PATHS = [os.path.join(PROJECT_ROOT, "locale")]
USE_I18N = True
-USE_L10N = True
USE_TZ = True
FORM_RENDERER = "django.forms.renderers.TemplatesSetting"
diff --git a/saleor/thumbnail/__init__.py b/saleor/thumbnail/__init__.py
index 8e04b2bc5a..d83267c0a5 100644
--- a/saleor/thumbnail/__init__.py
+++ b/saleor/thumbnail/__init__.py
@@ -1,5 +1,3 @@
-default_app_config = "saleor.thumbnail.app.ThumbnailAppConfig"
-
# defines the available thumbnail resolutions
THUMBNAIL_SIZES = [32, 64, 128, 256, 512, 1024, 2048, 4096]
diff --git a/saleor/thumbnail/app.py b/saleor/thumbnail/apps.py
similarity index 100%
rename from saleor/thumbnail/app.py
rename to saleor/thumbnail/apps.py