def METHOD_NAME(self):
    settings = self.request.registry.settings
    locale = self.request.validated['locale']
    document = self.request.validated['document']
    document_type = association_keys_for_types[document.type]
    document_path = "/{}/{}/{}".format(document_type,
                                       locale.document_id,
                                       locale.lang)
    content = '<a href="https://www.camptocamp.org{}">{}</a>'.format(
        document_path, locale.title or document_path)
    category = settings['discourse.category']
    # category could be id or name
    try:
        category = int(category)
    except Exception:
        pass
    client = get_discourse_client(settings)
    try:
        title = "{}_{}".format(locale.document_id, locale.lang)
        response = client.client.create_post(content,
                                             title=title,
                                             category=category)
    except Exception as e:
        log.error('Error with Discourse: {}'.format(str(e)), exc_info=True)
        raise HTTPInternalServerError('Error with Discourse')
    if "topic_id" in response:
        topic_id = response['topic_id']
        document_topic = DocumentTopic(topic_id=topic_id)
        locale.document_topic = document_topic
        update_cache_version_direct(locale.document_id)
        DBSession.flush()
        if locale.type == document_types.OUTING_TYPE:
            try:
                self.invite_participants(client, locale, topic_id)
            except Exception:
                log.error('Inviting participants of outing {} failed'
                          .format(locale.document_id),
                          exc_info=True)
    return response