- Timestamp:
- 29 Oct 2011, 17:26:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py
r6959 r6966 116 116 117 117 # It's quite dangerous to remove entire hostels with its content (beds). 118 # Thus, this remove d should be combined with an archiving function.118 # Thus, this remove method should be combined with an archiving function. 119 119 @grok.action('Remove selected') 120 120 def delHostels(self, **data): … … 123 123 deleted = [] 124 124 child_id = form['val_id'] 125 child_id = [child_id] 125 if not isinstance(child_id, list): 126 child_id = [child_id] 126 127 for id in child_id: 127 128 deleted.append(id) … … 152 153 self.applyData(hostel, **data) 153 154 hostel.hostel_id = data['hostel_name'].lower().replace(' ','_') 154 self.context.addHostel(hostel) 155 try: 156 self.context.addHostel(hostel) 157 except KeyError: 158 self.flash('The hostel already exists.') 159 return 155 160 self.flash('Hostel created.') 156 161 write_log_message(self, 'added: % s' % data['hostel_name'])
Note: See TracChangeset for help on using the changeset viewer.