Commit 00178f56 authored by VAN ZUIJLEN Nils's avatar VAN ZUIJLEN Nils
Browse files

Merge branch '73-migrer-vers-django-4-ou-3-2' into 'master'

Resolve "Migrer vers Django 3.2"

Closes #73

See merge request !69
parents 88e30f7f 04fc84e8
...@@ -15,3 +15,4 @@ collected_static ...@@ -15,3 +15,4 @@ collected_static
*.log *.log
*.out *.out
*.toc *.toc
*.kdev4
...@@ -9,9 +9,13 @@ flake8 = "*" ...@@ -9,9 +9,13 @@ flake8 = "*"
freezegun = "*" freezegun = "*"
coverage = "*" coverage = "*"
mypy = "*" mypy = "*"
types-redis = "*"
types-Markdown = "*"
types-requests = "*"
types-freezegun = "*"
[packages] [packages]
django = "~=2.2" django = "~=3.2"
django-redis-cache = "*" django-redis-cache = "*"
mysqlclient = "*" mysqlclient = "*"
redis = "*" redis = "*"
...@@ -23,8 +27,6 @@ django-redis-sessions = "*" ...@@ -23,8 +27,6 @@ django-redis-sessions = "*"
django-stubs = "*" django-stubs = "*"
beautifulsoup4 = "*" beautifulsoup4 = "*"
[requires]
python_version = "3.9"
[scripts] [scripts]
test = "./test.sh" test = "./test.sh"
......
This diff is collapsed.
...@@ -27,7 +27,7 @@ class OrderItemForm(forms.ModelForm): ...@@ -27,7 +27,7 @@ class OrderItemForm(forms.ModelForm):
def __init__(self, item=None, *args, **kwargs) -> None: def __init__(self, item=None, *args, **kwargs) -> None:
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
instance = getattr(self, "instance", None) instance = getattr(self, "instance")
if item is None: if item is None:
item = instance.item item = instance.item
......
...@@ -2,6 +2,7 @@ import csv ...@@ -2,6 +2,7 @@ import csv
import json import json
from typing import Any from typing import Any
from typing import Dict from typing import Dict
from typing import Optional
from typing import Type from typing import Type
from django.contrib import messages from django.contrib import messages
...@@ -529,7 +530,7 @@ class DeliveryView(PermissionRequiredMixin, ListView): ...@@ -529,7 +530,7 @@ class DeliveryView(PermissionRequiredMixin, ListView):
order__payment__paid=True, order__payment__paid=True,
).select_related("order__user__profile", "order__user", "item") ).select_related("order__user__profile", "order__user", "item")
def boolQueryParam(self, param): def boolQueryParam(self, param: str) -> Optional[bool]:
if param == 'true': if param == 'true':
return True return True
if param == 'false': if param == 'false':
...@@ -539,7 +540,7 @@ class DeliveryView(PermissionRequiredMixin, ListView): ...@@ -539,7 +540,7 @@ class DeliveryView(PermissionRequiredMixin, ListView):
def options(self, request: HttpRequest, *args: Any, **kwargs: Any) -> JsonResponse: def options(self, request: HttpRequest, *args: Any, **kwargs: Any) -> JsonResponse:
itemList = OrderItem.objects itemList = OrderItem.objects.all()
delivered = self.boolQueryParam(request.GET["delivered"]) delivered = self.boolQueryParam(request.GET["delivered"])
if delivered is False: if delivered is False:
......
...@@ -108,6 +108,8 @@ DATABASES = { ...@@ -108,6 +108,8 @@ DATABASES = {
} }
} }
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
FIXTURE_DIRS = ("fixtures/",) FIXTURE_DIRS = ("fixtures/",)
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment