Changeset 12413 for main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Timestamp:
- 7 Jan 2015, 09:20:45 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/browser.py
r12408 r12413 135 135 document = createObject('waeup.%s' % doctype) 136 136 self.applyData(document, **data) 137 self.context.addDocument(document) 137 try: 138 self.context.addDocument(document) 139 except KeyError: 140 self.flash(_('The id chosen already exists.'), 141 type='danger') 142 return 138 143 doctype = getUtility(IDocumentsUtils).SELECTABLE_DOCTYPES_DICT[doctype] 139 144 self.flash(_('${a} added.', mapping = {'a': doctype})) … … 141 146 self.context.__parent__.logger.info( 142 147 '%s - added: %s %s' % (ob_class, doctype, document.document_id)) 143 self.redirect(self.url(self.context, u'manage')) 148 self.redirect(self.url(self.context) + 149 '/%s/manage' % document.document_id) 144 150 return 145 151 -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py
r12408 r12413 117 117 118 118 # Document can be edited 119 self.browser.getLink("DOC1").click()120 self.browser.getLink("Manage").click()121 119 self.browser.getControl(name="form.title").value = 'My first doc' 122 120 self.browser.getControl("Save").click() … … 221 219 222 220 # Document can be edited 223 self.browser.getLink("DOC2").click()224 self.browser.getLink("Manage").click()225 221 self.browser.getControl(name="form.title").value = 'My second doc' 226 222 self.browser.getControl(name="form.html_multilingual").value = """ … … 310 306 311 307 # Document can be edited 312 self.browser.getLink("DOC3").click()313 self.browser.getLink("Manage").click()314 308 self.browser.getControl(name="form.rest_multilingual").value = """ 315 309 ----------
Note: See TracChangeset for help on using the changeset viewer.