<commit_before>{% extends "kolibri/base.html" %}
{% load learn_tags %}
{% load kolibri_tags %}
{% load cache %}

{% block content %}
  <!-- Bootstrapping the initial information for all channels. -->
  {% kolibri_bootstrap_collection 'channel' 'ChannelResource' %}
  <!-- Bootstrapping the root node for the current channel in Explore tab. -->
  {% kolibri_bootstrap_model 'contentnode' 'ContentNodeResource' kwargs_pk=currentChannel.root_id %}
  <!-- Bootstrapping the top level topics for current channel in Explore tab. -->
  {% kolibri_bootstrap_collection 'contentnode' 'ContentNodeResource' parent=currentChannel.root_id %}

  {% if request.user.is_facility_user %}
    <!-- Bootstrapping the the user's memberships. -->
    {% kolibri_bootstrap_collection 'membership' 'MembershipResource' user_id=user.id %}
  {% endif %}

  {% learn_async_assets %}
  {% learn_assets %}
{% endblock %}
<commit_msg>Only bootstrap data if we have a current channel.<commit_after>{% extends "kolibri/base.html" %}
{% load learn_tags %}
{% load kolibri_tags %}
{% load cache %}

{% block content %}
  <!-- Bootstrapping the initial information for all channels. -->
  {% kolibri_bootstrap_collection 'channel' 'ChannelResource' %}
  {% if currentChannel %}
    <!-- Bootstrapping the root node for the current channel in Explore tab. -->
    {% kolibri_bootstrap_model 'contentnode' 'ContentNodeResource' kwargs_pk=currentChannel.root_id %}
    <!-- Bootstrapping the top level topics for current channel in Explore tab. -->
    {% kolibri_bootstrap_collection 'contentnode' 'ContentNodeResource' parent=currentChannel.root_id %}
  {% endif %}

  {% if request.user.is_facility_user %}
    <!-- Bootstrapping the the user's memberships. -->
    {% kolibri_bootstrap_collection 'membership' 'MembershipResource' user_id=user.id %}
  {% endif %}

  {% learn_async_assets %}
  {% learn_assets %}
{% endblock %}

{'fraction_non_alphanumeric': 0.13132911392405064, 'fraction_numerical': 0.0, 'mean_word_length': 4.46685878962536, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7143114', 'n_tokens_mistral': 605, 'n_tokens_neox': 540, 'n_words': 143}