Merge branch 'rjb-issue-6' into 'master'
only display products for active shop. See merge request engineering/make-post-sell/make_post_sell!2
This commit is contained in:
commit
aa051792d5
1 changed files with 9 additions and 2 deletions
|
|
@ -1,6 +1,9 @@
|
|||
from pyramid.view import view_config
|
||||
|
||||
from . import user_required
|
||||
from . import (
|
||||
user_required,
|
||||
shop_is_ready_required,
|
||||
)
|
||||
|
||||
from ..models.user import (
|
||||
is_user_name_available,
|
||||
|
|
@ -17,9 +20,13 @@ def user_shops(request):
|
|||
|
||||
|
||||
@view_config(route_name="user_purchases", renderer="products.j2")
|
||||
@user_required()
|
||||
@shop_is_ready_required()
|
||||
def user_products(request):
|
||||
# only display products for the currently active shop.
|
||||
products = [p for p in request.user.products if p.shop == request.shop]
|
||||
return {
|
||||
"products": request.user.products,
|
||||
"products": products,
|
||||
"the_title": "My Purchases",
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue