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