def send_invoice(modeladmin, request, queryset):
   for registration in queryset:
     communicator = Communicator(registration)
     try:
       if registration.billing_type == 'email':
         communicator.send_invoice_email()
     except RuntimeError:
       logging.error("Invalid statuscode. Is cloudvoice working. Email wasn't sent")
 def handle_communication(reg_model):
     communicator = Communicator(reg_model)
     try:
         communicator.send_customer_registration()
         communicator.send_invoice_registration()
         if reg_model.billing_type == 'email':
             communicator.send_invoice_email()
         else:
             communicator.send_notification_email()
     except RuntimeError:
         logging.error("Invalid statuscode. Is cloudvoice working. Email wasn't sent")