Verified Commit bd100399 authored by VAN ZUIJLEN Nils's avatar VAN ZUIJLEN Nils
Browse files

Do necessary changes for new version

Add some typing
Specify default db pk field, kept the default to keep the same value as
before as pk migration are not generated
parent cb28ffcf
......@@ -27,7 +27,7 @@ class OrderItemForm(forms.ModelForm):
def __init__(self, item=None, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
instance = getattr(self, "instance", None)
instance = getattr(self, "instance")
if item is None:
item = instance.item
......
......@@ -2,6 +2,7 @@ import csv
import json
from typing import Any
from typing import Dict
from typing import Optional
from typing import Type
from django.contrib import messages
......@@ -529,7 +530,7 @@ class DeliveryView(PermissionRequiredMixin, ListView):
order__payment__paid=True,
).select_related("order__user__profile", "order__user", "item")
def boolQueryParam(self, param):
def boolQueryParam(self, param: str) -> Optional[bool]:
if param == 'true':
return True
if param == 'false':
......@@ -539,7 +540,7 @@ class DeliveryView(PermissionRequiredMixin, ListView):
def options(self, request: HttpRequest, *args: Any, **kwargs: Any) -> JsonResponse:
itemList = OrderItem.objects
itemList = OrderItem.objects.all()
delivered = self.boolQueryParam(request.GET["delivered"])
if delivered is False:
......
......@@ -108,6 +108,8 @@ DATABASES = {
}
}
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
FIXTURE_DIRS = ("fixtures/",)
......
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