Commit f66e9101 authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_free_subscription: simplify Alarm_acceptSubmittedFreeSubscriptionRequestList

parent 6bcbd1ed
portal = context.getPortalObject()
portal_preferences = portal.portal_preferences
searchAndActivate_ = portal.portal_catalog.searchAndActivate
def searchAndActivate(**kw):
searchAndActivate_('FreeSubscriptionRequest_accept', **kw)
portal_type_list = []
if portal_preferences.getPreferredFreeSubscriptionRequestAutomaticApproval():
portal_type_list.append('Free Subscription Request')
if portal_type_list:
searchAndActivate(
portal_type=portal_type_list,
if portal.portal_preferences.getPreferredFreeSubscriptionRequestAutomaticApproval():
portal.portal_catalog.searchAndActivate(
'FreeSubscriptionRequest_accept',
portal_type='Free Subscription Request',
validation_state='submitted',
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment