Passed
Push — 2.x ( fa98d6...054a36 )
by Jordi
04:42
created

senaite.core.adapters.sample   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A WorkflowActionDispatchAdapter.__call__() 0 6 1
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