Ignore:
Timestamp:
22 May 2011, 08:32:37 (13 years ago)
Author:
Henrik Bettermann
Message:

Select application_category for applicants containers.

Implement removal of applicants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6184 r6189  
    327327    @grok.action('Remove selected')
    328328    def delApplicant(self, **data):
    329         return self.flash('Removal of applicants is not yet implemented!')
     329        form = self.request.form
     330        if form.has_key('val_id'):
     331            child_id = form['val_id']
     332        else:
     333            self.flash('No applicant selected!')
     334            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
     335            return
     336        if not isinstance(child_id, list):
     337            child_id = [child_id]
     338        deleted = []
     339        for id in child_id:
     340            try:
     341                del self.context[id]
     342                deleted.append(id)
     343            except:
     344                self.flash('Could not delete %s: %s: %s' % (
     345                        id, sys.exc_info()[0], sys.exc_info()[1]))
     346        if len(deleted):
     347            self.flash('Successfully removed: %s' % ', '.join(deleted))
     348        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
     349        return
    330350
    331351    @grok.action('Add applicant', validator=NullValidator)
Note: See TracChangeset for help on using the changeset viewer.