Conditions | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
9 | def isFactoryContained(obj): |
||
10 | """Are we inside the portal_factory? |
||
11 | """ |
||
12 | if obj.isTemporary(): |
||
13 | return True |
||
14 | parent = aq_parent(aq_inner(obj)) |
||
15 | if parent is None: |
||
16 | # We don't have enough context to know where we are |
||
17 | return False |
||
18 | meta_type = getattr(aq_base(parent), "meta_type", "") |
||
19 | return meta_type == "TempFolder" |
||
20 | |||
24 |