def METHOD_NAME(organization, csv_buffer, csv_folder, csv_filename):
    # If the organization is not an external demo organization
    if (
        not settings.DEBUG
        and organization.organization_type
        != Organization.OrganizationType.EXTERNAL_DEMO
    ):
        try:
            # Upload the file to s3
            bucket_name, prod = get_bucket_name(organization)
            if s3_bucket_exists(bucket_name):
                logger.error("Bucket exists")
            else:
                s3.create_bucket(Bucket=bucket_name, ACL="private")
                logger.error("Created bucket", bucket_name)
            key = get_key(organization, csv_folder, csv_filename)
            if not prod:
                team_id = organization.team.team_id.hex
                team = organization.team
                team_id = team.team_id.hex + "-" + slugify(team.name)
                key = f"{team_id}/{key}"
            csv_bytes = csv_buffer.getvalue().encode()
            s3.Bucket(bucket_name).upload_fileobj(io.BytesIO(csv_bytes), key)
        except Exception as e:
            print(e)