зеркало из https://github.com/mozilla/kitsune.git
Merge pull request #6261 from akatsoulas/validate-active-topics-products
Validate only active topic/products
This commit is contained in:
Коммит
897e0723fc
|
@ -175,14 +175,13 @@ class DocumentForm(forms.ModelForm):
|
|||
|
||||
self.validate_relationship(
|
||||
selected_items=selected_topics,
|
||||
related_items=Topic.objects.filter(products__in=selected_products).distinct(),
|
||||
related_items=Topic.active.filter(products__in=selected_products).distinct(),
|
||||
item_type="topic",
|
||||
related_type="product",
|
||||
)
|
||||
|
||||
self.validate_relationship(
|
||||
selected_items=selected_products,
|
||||
related_items=Product.objects.filter(m2m_topics__in=selected_topics).distinct(),
|
||||
related_items=Product.active.filter(m2m_topics__in=selected_topics).distinct(),
|
||||
item_type="product",
|
||||
related_type="topic",
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче