Skip to content

Commit

Permalink
Made ActionView.get a classmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Jul 21, 2020
1 parent 0031dc3 commit fe1f088
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/labthings/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ class ActionView(View):
_deque = Deque() # Action queue
_emergency_pool = Pool()

def get(self):
""" """
queue_schema = build_action_schema(self.schema, self.args)(many=True)
return queue_schema.dump(self._deque)
@classmethod
def get(cls):
"""
Default method for GET requests. Returns the action queue (including already finished actions) for this action
"""
queue_schema = build_action_schema(cls.schema, cls.args)(many=True)
return queue_schema.dump(cls._deque)

@classmethod
def get_apispec(cls):
Expand Down

0 comments on commit fe1f088

Please sign in to comment.