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

def _process_mass_form ( f ) : def wrap ( request , * args , ** kwargs ) : user = request . user . profile if ( 'massform' in request . POST ) : for key in request . POST : if ( 'mass-contact' in key ) : try : contact = Contact . objects . get ( pk = request . POST [ key ] ) form = MassActionForm ( user , request . POST , instance = contact ) if ( form . is_valid ( ) and user . has_permission ( contact , mode = 'w' ) ) : form . save ( ) except Exception : 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 messages .