Total Complexity | 1 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | |||
3 | from bika.lims import api |
||
4 | from bika.lims.browser.workflow import RequestContextAware |
||
5 | from bika.lims.interfaces import IWorkflowActionUIDsAdapter |
||
6 | from zope.interface import implementer |
||
7 | |||
8 | |||
9 | @implementer(IWorkflowActionUIDsAdapter) |
||
10 | class WorkflowActionDispatchAdapter(RequestContextAware): |
||
11 | """Adapter in charge of Sample "dispatch" action |
||
12 | """ |
||
13 | |||
14 | def __call__(self, action, uids): |
||
15 | """Redirects the user to the dispatch form |
||
16 | """ |
||
17 | url = "{}/dispatch_samples?uids={}".format( |
||
18 | api.get_url(self.context), ",".join(uids)) |
||
19 | return self.redirect(redirect_url=url) |
||
20 |