Disallow choosing non-game purchase as related purchase

This commit is contained in:
2023-11-14 19:55:19 +01:00
parent f31280c682
commit 62cd17f702
2 changed files with 8 additions and 1 deletions

View File

@ -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: