Commits

Kai Diefenbach committed d6ca513

Bugfix category management products tab: display only products which are not assigned to the category.

  • Participants
  • Parent commits 06e93f2

Comments (0)

Files changed (1)

lfs/manage/views/categories/products.py

 from lfs.catalog.models import Product
 
 
-# Parts
+# Views
 @permission_required("core.manage_shop", login_url="/login/")
 def manage_products(request, category_id, template_name="manage/category/products.html"):
     """
     }))
 
 
+# Parts
 @permission_required("core.manage_shop", login_url="/login/")
 def products_inline(request, category_id, as_string=False, template_name="manage/category/products_inline.html"):
     """Displays the products-tab of a category.
     """
     category = Category.objects.get(pk=category_id)
 
-    products = category.get_products()
+    products = Product.objects.filter(categories=category)
     product_ids = [p.id for p in products]
 
     if request.REQUEST.get("keep-session"):
         }))
 
 
-# Actions
 @permission_required("core.manage_shop", login_url="/login/")
 def add_products(request, category_id):
     """Adds products (passed via request body) to category with passed id.