old_contents: import json
  import requests
  
  from django.core.exceptions import ImproperlyConfigured
  from django.db import connection
  from requests.exceptions import MissingSchema
  
  from bluebottle.clients import properties
  
  
  class PayoutValidationError(Exception):
      pass
  
  
  class PayoutCreationError(Exception):
      pass
  
  
  class DoradoPayoutAdapter(object):
  
      def __init__(self, project):
          self.settings = getattr(properties, 'PAYOUT_SERVICE', None)
          self.project = project
          self.tenant = connection.tenant
  
      def trigger_payout(self):
          # Send the signal to Dorado
          data = {
              'project_id': self.project.id,
              'tenant': self.tenant.schema_name
          }
  
          try:
              response = requests.post(self.settings['url'], data)
              response.raise_for_status()
          except requests.HTTPError:
              try:
                  raise PayoutValidationError(json.loads(response.content))
              except ValueError:
                  raise PayoutCreationError(response.content)
          except MissingSchema:
              raise ImproperlyConfigured("Incorrect Payout URL")
          except IOError, e:
              raise PayoutCreationError(unicode(e))
          except TypeError:
              raise ImproperlyConfigured("Invalid Payout settings")
  
new_contents: import json
  import requests
  
  from django.core.exceptions import ImproperlyConfigured
  from django.db import connection
  from requests.exceptions import MissingSchema
  
  from bluebottle.clients import properties
  
  
  class PayoutValidationError(Exception):
      pass
  
  
  class PayoutCreationError(Exception):
      pass
  
  
  class DoradoPayoutAdapter(object):
  
      def __init__(self, project):
          self.settings = getattr(properties, 'PAYOUT_SERVICE', None)
          self.project = project
          self.tenant = connection.tenant
  
      def trigger_payout(self):
          # Send the signal to Dorado
          data = {
              'project_id': self.project.id,
              'tenant': self.tenant.client_name
          }
  
          try:
              response = requests.post(self.settings['url'], data)
              response.raise_for_status()
          except requests.HTTPError:
              try:
                  raise PayoutValidationError(json.loads(response.content))
              except ValueError:
                  raise PayoutCreationError(response.content)
          except MissingSchema:
              raise ImproperlyConfigured("Incorrect Payout URL")
          except IOError, e:
              raise PayoutCreationError(unicode(e))
          except TypeError:
              raise ImproperlyConfigured("Invalid Payout settings")
  
subject: Make sure that we use the client name for tenant instead of schema name (#2694)