<commit_before>from mitxmako.shortcuts import render_to_response
from courseware.courses import get_course_with_access
from notes.models import Note
import json
import logging

log = logging.getLogger(__name__)

def notes(request, course_id):
    ''' Displays a student's notes in a course. '''
    course = get_course_with_access(request.user, course_id, 'load')

    notes = Note.objects.filter(course_id=course_id, user=request.user).order_by('-created', 'uri')

    prettyprint = {'sort_keys':True, 'indent':2, 'separators':(',', ': ')}
    json_notes = json.dumps([n.as_dict() for n in notes], **prettyprint)

    context = {
        'course': course,
        'notes': notes,
        'json_notes': json_notes
    }

    return render_to_response('notes.html', context)
<commit_msg>remove debugging from default notes view<commit_after>from django.contrib.auth.decorators import login_required
from mitxmako.shortcuts import render_to_response
from courseware.courses import get_course_with_access
from notes.models import Note
import json

@login_required
def notes(request, course_id):
    ''' Displays a student's notes in a course. '''
    course = get_course_with_access(request.user, course_id, 'load')
    
    notes = Note.objects.filter(course_id=course_id, user=request.user).order_by('-created', 'uri')
    json_notes = json.dumps([n.as_dict() for n in notes])
    context = {
        'course': course,
        'notes': notes,
        'json_notes': json_notes
    }

    return render_to_response('notes.html', context)

{'fraction_non_alphanumeric': 0.11726384364820847, 'fraction_numerical': 0.0006514657980456026, 'mean_word_length': 4.351916376306621, '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': '750360', 'n_tokens_mistral': 484, 'n_tokens_neox': 469, 'n_words': 115}