Ignore:
Timestamp:
11 Feb 2015, 11:59:34 (10 years ago)
Author:
Henrik Bettermann
Message:

Add 'active' property attribute. Use this attribute to show only active (valid) products to anonymous users.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py

    r12585 r12592  
    1919"""
    2020import grok
    21 from datetime import date
    2221from zope.component import getUtility, queryUtility
    2322from zope.catalog.interfaces import ICatalog
     
    168167        if not concat:
    169168            return products
    170         now = date.today()
     169       
    171170        resultlist = [
    172171            value for value in products
    173             if value.contract_category == concat
    174                 and (not value.valid_from or value.valid_from <= now)
    175                 and (not value.valid_to or value.valid_to >= now)
     172            if value.contract_category == concat and value.active
    176173            ]
    177174        return resultlist
Note: See TracChangeset for help on using the changeset viewer.