def _process_mass_lead_form(f):
 def wrap(request, *args, **kwargs):
  'Wrap'
  if ('massform' in request.POST):
   for key in request.POST:
    if ('mass-lead' in key):
     try:
      lead = Lead.objects.get(pk=request.POST[key])
      form = LeadMassActionForm(request.user.profile, request.POST, instance=lead)
      if (form.is_valid() and request.user.profile.has_permission(lead, mode='w')):
       form.save()
     except:
      pass
  return f(request, *args, **kwargs)
 wrap.__doc__ = f.__doc__
 wrap.__name__ = f.__name__
 return wrap

def _process_mass_lead_form ( f ) : def wrap ( request , * args , ** kwargs ) : if ( 'massform' in request . POST ) : for key in request . POST : if ( 'mass-lead' in key ) : try : lead = Lead . objects . get ( pk = request . POST [ key ] ) form = LeadMassActionForm ( request . user . profile , request . POST , instance = lead ) if ( form . is_valid ( ) and request . user . profile . has_permission ( lead , mode = 'w' ) ) : form . save ( ) except : pass return f ( request , * args , ** kwargs ) wrap . __doc__ = f . __doc__ wrap . __name__ = f . __name__ return wrap
pre-process request to handle mass action form for orders .