Commit f66e9101 authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_free_subscription: simplify Alarm_acceptSubmittedFreeSubscriptionRequestList

parent 6bcbd1ed
portal = context.getPortalObject() portal = context.getPortalObject()
portal_preferences = portal.portal_preferences if portal.portal_preferences.getPreferredFreeSubscriptionRequestAutomaticApproval():
searchAndActivate_ = portal.portal_catalog.searchAndActivate portal.portal_catalog.searchAndActivate(
def searchAndActivate(**kw): 'FreeSubscriptionRequest_accept',
searchAndActivate_('FreeSubscriptionRequest_accept', **kw) portal_type='Free Subscription Request',
portal_type_list = []
if portal_preferences.getPreferredFreeSubscriptionRequestAutomaticApproval():
portal_type_list.append('Free Subscription Request')
if portal_type_list:
searchAndActivate(
portal_type=portal_type_list,
validation_state='submitted', 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