Uploaded image for project: 'openATTIC'
  1. openATTIC
  2. OP-1473

Objects ID parameter in REST API request DATA dictionary

    XMLWordPrintable

    Details

    • Story Points:
      8
    • Sprint:
      Sprint 18

      Description

      Some views of our REST API require an ID parameter in the request DATA dictionary to get the related Django object.

      For example in volumes/restapi.py, class "VolumeViewSet", method "update" (line 440 currently):

      def update(self, request, *args, **kwargs):
              storageobj = models.StorageObject.objects.get(id=request.DATA["id"])
              ....
      

      We could change these lines to:

       def update(self, request, *args, **kwargs):
              storageobj = self.get_object_or_none()
              ....
      

      or:

       def update(self, request, *args, **kwargs):
              storageobj = self.get_object()
              ....
      

      And the ID parameter is no longer required.

      Adjust Gatling tests as well (just remove the ID parameter).

        Attachments

          Activity

            People

            Assignee:
            tdehler Dehler, Tatjana
            Reporter:
            tdehler Dehler, Tatjana
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: