0001-admin-don-t-display-prefill-option-for-backoffice-fi.patch
tests/test_admin_pages.py | ||
---|---|---|
1691 | 1691 |
assert workflow.backoffice_fields_formdef.fields[0].id == 'bo1' |
1692 | 1692 |
assert workflow.backoffice_fields_formdef.fields[1].id == 'bo2' |
1693 | 1693 | |
1694 |
# check there's no prefill field |
|
1695 |
resp = app.get('/backoffice/workflows/1/backoffice-fields/fields/bo2/') |
|
1696 |
assert not 'prefill$type' in resp.form.fields.keys() |
|
1697 | ||
1694 | 1698 |
# add a title field |
1695 | 1699 |
resp = app.get('/backoffice/workflows/1/backoffice-fields/fields/') |
1696 | 1700 |
resp.forms[0]['label'] = 'foobar3' |
wcs/admin/workflows.py | ||
---|---|---|
835 | 835 |
class WorkflowBackofficeFieldDefPage(FieldDefPage): |
836 | 836 |
section = 'workflows' |
837 | 837 | |
838 |
def form(self): |
|
839 |
form = super(WorkflowBackofficeFieldDefPage, self).form() |
|
840 |
form.remove('prefill') |
|
841 |
return form |
|
842 | ||
838 | 843 | |
839 | 844 |
class WorkflowVariablesFieldsDirectory(FieldsDirectory): |
840 | 845 |
_q_exports = ['', 'update_order', 'new'] |
wcs/qommon/form.py | ||
---|---|---|
295 | 295 | |
296 | 296 |
def remove(self, name): |
297 | 297 |
widget = self._names.get(name) |
298 |
del self._names[name] |
|
299 |
self.widgets.remove(widget) |
|
298 |
if widget: |
|
299 |
del self._names[name] |
|
300 |
self.widgets.remove(widget) |
|
300 | 301 | |
301 | 302 |
def get_all_widgets(self): |
302 | 303 |
l = QuixoteForm.get_all_widgets(self) |
303 |
- |