Disallow choosing non-game purchase as related purchase

This commit is contained in:
Lukáš Kucharczyk 2023-11-14 19:55:19 +01:00
parent 29d6cb8a4a
commit d280fa3798
2 changed files with 8 additions and 1 deletions

View File

@ -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 ## 1.5.0 / 2023-11-14 19:27+01:00
## New ## New

View File

@ -56,7 +56,9 @@ class PurchaseForm(forms.ModelForm):
) )
platform = forms.ModelChoiceField(queryset=Platform.objects.order_by("name")) platform = forms.ModelChoiceField(queryset=Platform.objects.order_by("name"))
related_purchase = forms.ModelChoiceField( 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: class Meta: