Beispiel #1
0
 def obj_create(self, bundle, request=None, review_id=None, **kwargs):
     if 'note' in bundle.data and bundle.data['note'].strip():
         bundle.data['flag'] = ReviewFlag.OTHER
     Review.objects.filter(id=review_id).update(editorreview=True)
     return MarketplaceModelResource.obj_create(
         self, bundle, request=request, review_id=review_id,
         user=request.amo_user)
Beispiel #2
0
 def post_list(self, request, review_id=None, **kwargs):
     if ReviewFlag.objects.filter(review_id=review_id,
                                  user=request.amo_user).exists():
         return http.HttpConflict()
     return MarketplaceModelResource.post_list(self,
                                               request,
                                               review_id=review_id,
                                               **kwargs)
Beispiel #3
0
 def obj_create(self, bundle, request=None, review_id=None, **kwargs):
     if 'note' in bundle.data and bundle.data['note'].strip():
         bundle.data['flag'] = ReviewFlag.OTHER
     Review.objects.filter(id=review_id).update(editorreview=True)
     return MarketplaceModelResource.obj_create(self,
                                                bundle,
                                                request=request,
                                                review_id=review_id,
                                                user=request.amo_user)
Beispiel #4
0
 def get_object_list(self, request):
     qs = MarketplaceModelResource.get_object_list(self, request)
     # Mature regions show only reviews from within that region.
     if not request.REGION.adolescent:
         qs = qs.filter(client_data__region=request.REGION.id)
     return qs
Beispiel #5
0
 def get_object_list(self, request):
     qs = MarketplaceModelResource.get_object_list(self, request)
     return qs.filter(user=request.amo_user, inactive=False)
Beispiel #6
0
 def post_list(self, request, review_id=None, **kwargs):
     if ReviewFlag.objects.filter(review_id=review_id,
                                  user=request.amo_user).exists():
         return http.HttpConflict()
     return MarketplaceModelResource.post_list(
         self, request, review_id=review_id, **kwargs)
Beispiel #7
0
 def get_object_list(self, request):
     qs = MarketplaceModelResource.get_object_list(self, request)
     # Mature regions show only reviews from within that region.
     if not request.REGION.adolescent:
         qs = qs.filter(client_data__region=request.REGION.id)
     return qs
Beispiel #8
0
 def get_object_list(self, request):
     qs = MarketplaceModelResource.get_object_list(self, request)
     return qs.filter(user=request.amo_user, inactive=False)