Пример #1
0
 def flags(self, request, **kwargs):
     addon = get_object_or_404(Addon, pk=kwargs['pk'])
     instance, _ = AddonReviewerFlags.objects.get_or_create(addon=addon)
     serializer = AddonReviewerFlagsSerializer(
         instance, data=request.data, partial=True)
     serializer.is_valid(raise_exception=True)
     # If pending info request was modified, log it.
     if 'pending_info_request' in serializer.initial_data:
         ActivityLog.create(amo.LOG.ADMIN_ALTER_INFO_REQUEST, addon)
     serializer.save()
     return Response(serializer.data)
Пример #2
0
 def flags(self, request, **kwargs):
     addon = get_object_or_404(Addon, pk=kwargs['pk'])
     instance, _ = AddonReviewerFlags.objects.get_or_create(addon=addon)
     serializer = AddonReviewerFlagsSerializer(
         instance, data=request.data, partial=True)
     serializer.is_valid(raise_exception=True)
     # If pending info request was modified, log it.
     if 'pending_info_request' in serializer.initial_data:
         ActivityLog.create(amo.LOG.ADMIN_ALTER_INFO_REQUEST, addon)
     serializer.save()
     return Response(serializer.data)