Total Complexity | 2 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | # |
||
3 | # This file is part of SENAITE.CORE |
||
4 | # |
||
5 | # Copyright 2018 by it's authors. |
||
6 | # Some rights reserved. See LICENSE.rst, CONTRIBUTORS.rst. |
||
7 | |||
8 | from bika.lims import api |
||
9 | from bika.lims.interfaces import ICancellable |
||
10 | from plone.indexer import indexer |
||
11 | |||
12 | @indexer(ICancellable) |
||
13 | def cancellation_state(instance): |
||
14 | """Acts as a mask for cancellation_workflow for those content types that are |
||
15 | not bound to this workflow. Returns 'active' or 'cancelled' |
||
16 | """ |
||
17 | if api.get_workflow_status_of(instance) == "cancelled": |
||
18 | return "cancelled" |
||
19 | return "active" |
||
20 |