<commit_before>from rest_framework import viewsets, permissions
from sprints.models import Sprint
from sprints.serializers import SprintSerializer
from task_burndown.permissions import IsOwnerOrReadOnly


class SprintViewSet(viewsets.ModelViewSet):
    """
    This viewset automatically provides `list`, `create`, `retrieve`,
    `update` and `destroy` actions.

    Additionally we also provide an extra `highlight` action.
    """
    queryset = Sprint.objects.all()
    serializer_class = SprintSerializer
    permission_classes = (permissions.IsAuthenticated, IsOwnerOrReadOnly,)

    def pre_save(self, obj):
        obj.account = self.request.user<commit_msg>limited queryset to current user<commit_after>from rest_framework import viewsets, permissions
from sprints.models import Sprint
from sprints.serializers import SprintSerializer
from task_burndown.permissions import IsOwner


class SprintViewSet(viewsets.ModelViewSet):
    """
    This viewset automatically provides `list`, `create`, `retrieve`,
    `update` and `destroy` actions.

    Additionally we also provide an extra `highlight` action.
    """
    serializer_class = SprintSerializer
    permission_classes = (permissions.IsAuthenticated, IsOwner,)

    def pre_save(self, obj):
        obj.account = self.request.user

    def get_queryset(self):
        return Sprint.objects.filter(account=self.request.user)
{'fraction_non_alphanumeric': 0.0814121037463977, 'fraction_numerical': 0.0, 'mean_word_length': 4.623481781376518, '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': '6048322', 'n_tokens_mistral': 385, 'n_tokens_neox': 363, 'n_words': 105}