<commit_before>from flask import request, Module, flash, render_template, \
                  redirect, url_for, abort, g

from codebox.apps.auth.models import User
from codebox.apps.auth.decorators import login_required
from codebox.apps.organizations.decorators import can_view_org
from codebox.apps.organizations.models import Organization
from codebox.apps.snippets.models import Snippet
from codebox.apps.snippets.forms import NewSnippetForm
from codebox.utils.shortcuts import get_object_or_404

frontend = Module(__name__)

@frontend.route('/')
@login_required
def dashboard():
    """
    Shows organizations/recent pastes/etc
    """

    snippets = list(Snippet.objects.for_index('dashboard', g.user.pk, 0, 10))
    snippets_users = User.objects.get_many([s.user for s in snippets])
    
    my_organizations = g.user.get_all_organizations()

    return render_template('snippets/dashboard.html', **{
            'snippets': snippets,
            'snippets_users': dict([(u.pk, u) for u in snippets_users]),
            'my_organizations': my_organizations,
            })<commit_msg>my_orgs no longer needs passed via the view<commit_after>from flask import request, Module, flash, render_template, \
                  redirect, url_for, abort, g

from codebox.apps.auth.models import User
from codebox.apps.auth.decorators import login_required
from codebox.apps.organizations.decorators import can_view_org
from codebox.apps.organizations.models import Organization
from codebox.apps.snippets.models import Snippet
from codebox.apps.snippets.forms import NewSnippetForm
from codebox.utils.shortcuts import get_object_or_404

frontend = Module(__name__)

@frontend.route('/')
@login_required
def dashboard():
    """
    Shows organizations/recent pastes/etc
    """

    snippets = list(Snippet.objects.for_index('dashboard', g.user.pk, 0, 10))
    snippets_users = User.objects.get_many([s.user for s in snippets])
    
    return render_template('snippets/dashboard.html', **{
            'snippets': snippets,
            'snippets_users': dict([(u.pk, u) for u in snippets_users]),
            })
{'fraction_non_alphanumeric': 0.10080454330336015, 'fraction_numerical': 0.005679129200189304, 'mean_word_length': 3.916279069767442, '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': '6514753', 'n_tokens_mistral': 665, 'n_tokens_neox': 625, 'n_words': 151}