Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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
Exemple #5
0
 def get_object_list(self, request):
     qs = MarketplaceModelResource.get_object_list(self, request)
     return qs.filter(user=request.amo_user, inactive=False)
Exemple #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)
Exemple #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
Exemple #8
0
 def get_object_list(self, request):
     qs = MarketplaceModelResource.get_object_list(self, request)
     return qs.filter(user=request.amo_user, inactive=False)