<commit_before>from lithium.blog.models import Post

def decorator(request, view, author=None, tag=None, *args, **kwargs):
    """
    A view decotator to change the queryset depending on whether
    a user may read private posts.
    """
    
    if request.user.has_perm('blog.can_read_private'):
        kwargs['queryset'] = Post.on_site.all(allow_private=True)
    
    if author:
        kwargs['queryset'] = kwargs['queryset'].filter(author__username=author)
    
    if tag:
        kwargs['queryset'] = kwargs['queryset'].filter(category__slug=tag)
    
    return view(request, *args, **kwargs)<commit_msg>Allow users with the permission 'blog.can_read_private' to see posts from the future.<commit_after>from lithium.blog.models import Post

def decorator(request, view, author=None, tag=None, *args, **kwargs):
    """
    A view decotator to change the queryset depending on whether
    a user may read private posts.
    """
    
    if request.user.has_perm('blog.can_read_private'):
        kwargs['queryset'] = Post.on_site.all(allow_private=True)
        kwargs['allow_future'] = True
    
    if author:
        kwargs['queryset'] = kwargs['queryset'].filter(author__username=author)
    
    if tag:
        kwargs['queryset'] = kwargs['queryset'].filter(category__slug=tag)
    
    return view(request, *args, **kwargs)
{'fraction_non_alphanumeric': 0.12313432835820895, 'fraction_numerical': 0.0, 'mean_word_length': 3.57679180887372, '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': '1510707', 'n_tokens_mistral': 402, 'n_tokens_neox': 402, 'n_words': 98}