From d280fa37985b57914a39e147d48d6566e2cdc352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Tue, 14 Nov 2023 19:55:19 +0100 Subject: [PATCH] Disallow choosing non-game purchase as related purchase --- CHANGELOG.md | 5 +++++ games/forms.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f43b61..81d15c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.5.1 / 2023-11-14 19:55+01:00 + +## Improved +* Disallow choosing non-game purchase as related purchase + ## 1.5.0 / 2023-11-14 19:27+01:00 ## New diff --git a/games/forms.py b/games/forms.py index 08289d3..b92e8f5 100644 --- a/games/forms.py +++ b/games/forms.py @@ -56,7 +56,9 @@ class PurchaseForm(forms.ModelForm): ) platform = forms.ModelChoiceField(queryset=Platform.objects.order_by("name")) related_purchase = forms.ModelChoiceField( - queryset=Purchase.objects.order_by("edition__sort_name") + queryset=Purchase.objects.filter(type=Purchase.GAME).order_by( + "edition__sort_name" + ) ) class Meta: