<commit_before>
import superdesk

from flask import current_app as app
from superdesk.utils import ListCursor


class ClientConfigResource(superdesk.Resource):
    item_methods = []
    public_methods = ['GET']
    resource_methods = ['GET']


class ClientConfigService(superdesk.Service):

    def get(self, req, lookup):
        return ListCursor()

    def on_fetched(self, docs):
        docs['config'] = getattr(app, 'client_config', {})


def init_app(app):
    superdesk.register_resource('client_config', ClientConfigResource, ClientConfigService, _app=app)
    app.client_config.update({
        'schema': app.config.get('SCHEMA'),
        'editor': app.config.get('EDITOR'),
        'feedback_url': app.config.get('FEEDBACK_URL'),
        'override_ednote_for_corrections': app.config.get('OVERRIDE_EDNOTE_FOR_CORRECTIONS', True),
        'override_ednote_template': app.config.get('OVERRIDE_EDNOTE_TEMPLATE'),
        'default_genre': app.config.get('DEFAULT_GENRE_VALUE_FOR_MANUAL_ARTICLES'),
        'japanese_characters_per_minute': app.config.get('JAPANESE_CHARACTERS_PER_MINUTE'),
        'validator_media_metadata': app.config.get('VALIDATOR_MEDIA_METADATA', {}),
        'publish_content_expiry_minutes': app.config.get('PUBLISHED_CONTENT_EXPIRY_MINUTES', 0),
        'high_priority_queue_enabled': app.config.get('HIGH_PRIORITY_QUEUE_ENABLED'),
        'default_language': app.config.get('DEFAULT_LANGUAGE'),
        'workflow_allow_multiple_updates': app.config.get('WORKFLOW_ALLOW_MULTIPLE_UPDATES'),
        'disallowed_characters': app.config.get('DISALLOWED_CHARACTERS'),
    })<commit_msg>Sent publish associated item flag as client config. SDESK-4946 (#1780)<commit_after>
import superdesk

from flask import current_app as app
from superdesk.utils import ListCursor


class ClientConfigResource(superdesk.Resource):
    item_methods = []
    public_methods = ['GET']
    resource_methods = ['GET']


class ClientConfigService(superdesk.Service):

    def get(self, req, lookup):
        return ListCursor()

    def on_fetched(self, docs):
        docs['config'] = getattr(app, 'client_config', {})


def init_app(app):
    superdesk.register_resource('client_config', ClientConfigResource, ClientConfigService, _app=app)
    app.client_config.update({
        'schema': app.config.get('SCHEMA'),
        'editor': app.config.get('EDITOR'),
        'feedback_url': app.config.get('FEEDBACK_URL'),
        'override_ednote_for_corrections': app.config.get('OVERRIDE_EDNOTE_FOR_CORRECTIONS', True),
        'override_ednote_template': app.config.get('OVERRIDE_EDNOTE_TEMPLATE'),
        'default_genre': app.config.get('DEFAULT_GENRE_VALUE_FOR_MANUAL_ARTICLES'),
        'japanese_characters_per_minute': app.config.get('JAPANESE_CHARACTERS_PER_MINUTE'),
        'validator_media_metadata': app.config.get('VALIDATOR_MEDIA_METADATA', {}),
        'publish_content_expiry_minutes': app.config.get('PUBLISHED_CONTENT_EXPIRY_MINUTES', 0),
        'high_priority_queue_enabled': app.config.get('HIGH_PRIORITY_QUEUE_ENABLED'),
        'default_language': app.config.get('DEFAULT_LANGUAGE'),
        'workflow_allow_multiple_updates': app.config.get('WORKFLOW_ALLOW_MULTIPLE_UPDATES'),
        'disallowed_characters': app.config.get('DISALLOWED_CHARACTERS'),
        'publish_associated_items': app.config.get('PUBLISH_ASSOCIATED_ITEMS'),
    })
{'fraction_non_alphanumeric': 0.12451708766716196, 'fraction_numerical': 0.0029717682020802376, 'mean_word_length': 4.98932384341637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1031685', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1097, 'n_words': 149}