|
9 | 9 |
|
10 | 10 | from ..actions.pool import Pool
|
11 | 11 | from ..deque import Deque
|
12 |
| -from ..event import PropertyStatusEvent |
13 | 12 | from ..find import current_labthing
|
14 | 13 | from ..marshalling import marshal_with, use_args
|
15 | 14 | from ..representations import DEFAULT_REPRESENTATIONS
|
@@ -180,12 +179,6 @@ def dispatch_request(self, *args, **kwargs):
|
180 | 179 | if self.default_stop_timeout is not None:
|
181 | 180 | task.default_stop_timeout = self.default_stop_timeout
|
182 | 181 |
|
183 |
| - # Keep a copy of the raw, unmarshalled JSON input in the task |
184 |
| - try: |
185 |
| - task.input = request.json |
186 |
| - except BadRequest: |
187 |
| - task.input = None |
188 |
| - |
189 | 182 | # Wait up to 2 second for the action to complete or error
|
190 | 183 | try:
|
191 | 184 | task.get(block=True, timeout=self.wait_for)
|
@@ -239,22 +232,7 @@ def dispatch_request(self, *args, **kwargs):
|
239 | 232 | meth = marshal_with(self.schema)(meth)
|
240 | 233 |
|
241 | 234 | # Generate basic response
|
242 |
| - resp = self.represent_response(meth(*args, **kwargs)) |
243 |
| - |
244 |
| - # Emit property event |
245 |
| - if request.method in ("POST", "PUT"): |
246 |
| - property_value = self.get_value() |
247 |
| - property_name = getattr(self, "endpoint", None) or getattr( |
248 |
| - self, "__name__", "unknown" |
249 |
| - ) |
250 |
| - |
251 |
| - if current_labthing(): |
252 |
| - current_labthing().message( |
253 |
| - PropertyStatusEvent(property_name), |
254 |
| - property_value, |
255 |
| - ) |
256 |
| - |
257 |
| - return resp |
| 235 | + return self.represent_response(meth(*args, **kwargs)) |
258 | 236 |
|
259 | 237 |
|
260 | 238 | class EventView(View):
|
|
0 commit comments