0001-cards-do-not-disable-card-after-duplication-35934.patch
tests/test_admin_pages.py | ||
---|---|---|
5194 | 5194 |
assert '<h2>card title' in resp.body |
5195 | 5195 |
assert CardDef.get(1).workflow_id is None |
5196 | 5196 |
assert CardDef.get(1).disabled is False |
5197 | ||
5198 |
def test_cards_duplicate(pub, studio): |
|
5199 |
test_cards_new(pub, studio) |
|
5200 |
app = login(get_app(pub)) |
|
5201 |
resp = app.get('http://example.net/backoffice/cards/1/') |
|
5202 |
resp = resp.click('Duplicate') |
|
5203 |
assert CardDef.get(2).name == 'card title (copy)' |
|
5204 |
assert CardDef.get(2).disabled is False |
wcs/backoffice/cards.py | ||
---|---|---|
179 | 179 |
r += htmltext('</div>') |
180 | 180 |
return r.getvalue() |
181 | 181 | |
182 |
def duplicate(self): |
|
183 |
response = super(CardDefPage, self).duplicate() |
|
184 |
self.formdefui.formdef.disabled = False |
|
185 |
self.formdefui.formdef.store() |
|
186 |
return response |
|
187 | ||
182 | 188 |
def get_sidebar(self): |
183 | 189 |
r = TemplateIO(html=True) |
184 | 190 |
r += htmltext('<ul id="sidebar-actions">') |
185 |
- |