Isso

On Thursday, December 12, 2013, Fernando Rocha wrote:

> In musicstore/purchases/views.py:
>
> > +from rest_framework import generics
> > +from model_mommy import mommy
> > +
> > +from .models import Purchase
> > +from .serializers import TrackPurchaseSerializer
> > +
> > +
> > +class TrackPurchaseView(generics.CreateAPIView):
> > +    model = Purchase
> > +    serializer_class = TrackPurchaseSerializer
> > +
> > +    def get_serializer(self, data=None, *args, **kwargs):
> > +        data = data.copy()
> > +
> > +        # replace with current user
> > +        data['user'] = mommy.make('auth.User').id
>
> Por conta de ainda não ter autenticação?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/rest-in-peace/music_store_draft/pull/14/files#r8296939>
> .
>


-- 

*Filipe Ximenes*
+55 (81) 9674-7981