Example #1
0
    def update(self, request, addon_id):
        addon = self.get_object_or_none()
        if addon is None:
            return Response(status=410)

        form = AddonForm(request.DATA, instance=addon)
        if not form.is_valid():
            return _form_error(form)

        serializer = self.serializer_class(form.save())
        return Response(serializer.data)
Example #2
0
    def update(self, request, addon_id):
        addon = self.get_object_or_none()
        if addon is None:
            return Response(status=410)

        form = AddonForm(request.DATA, instance=addon)
        if not form.is_valid():
            return _form_error(form)

        serializer = self.serializer_class(form.save())
        return Response(serializer.data)
Example #3
0
 def update(self, request, addon):
     form = AddonForm(request.PUT, instance=addon)
     if not form.is_valid():
         return _form_error(form)
     a = form.save()
     return a
Example #4
0
 def update(self, request, addon):
     form = AddonForm(request.PUT, instance=addon)
     if not form.is_valid():
         return _form_error(form)
     a = form.save()
     return a