0001-api-fix-formdef-dependencies-in-post-conditions-7125.patch
tests/api/test_export_import.py | ||
---|---|---|
134 | 134 |
formdef.name = 'Test ter' |
135 | 135 |
formdef.store() |
136 | 136 |
formdef = FormDef() |
137 |
formdef.name = 'Test quater' |
|
138 |
formdef.store() |
|
139 |
formdef = FormDef() |
|
137 | 140 |
formdef.name = 'Test' |
138 | 141 |
formdef.store() |
139 | 142 | |
... | ... | |
229 | 232 |
type='page', |
230 | 233 |
post_conditions=[ |
231 | 234 |
{ |
232 |
'condition': {'type': 'django', 'value': '{{ cards|objects:"test-bis" }}'}, |
|
235 |
'condition': { |
|
236 |
'type': 'django', |
|
237 |
'value': '{{ cards|objects:"test-bis" }} {{ forms|objects:"test-quater" }}', |
|
238 |
}, |
|
233 | 239 |
'error_message': 'You shall not pass.', |
234 | 240 |
} |
235 | 241 |
], |
... | ... | |
260 | 266 |
('test-bis', 'cards'), |
261 | 267 |
('test-bis', 'forms'), |
262 | 268 |
('test-ter', 'forms'), |
269 |
('test-quater', 'forms'), |
|
263 | 270 |
('second-role', 'roles'), |
264 | 271 |
('third-role', 'roles'), |
265 | 272 |
} |
wcs/fields.py | ||
---|---|---|
3071 | 3071 |
condition = post_condition.get('condition') or {} |
3072 | 3072 |
if condition.get('type') == 'django': |
3073 | 3073 |
yield from check_carddefs(condition.get('value')) |
3074 |
yield from check_formdefs(condition.get('')) |
|
3074 |
yield from check_formdefs(condition.get('value'))
|
|
3075 | 3075 | |
3076 | 3076 | |
3077 | 3077 |
register_field_class(PageField) |
3078 |
- |