Changeset 8635 for main/waeup.kofa


Ignore:
Timestamp:
6 Jun 2012, 07:38:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Catch RequiredMissing? error when creating students from applicants.

Add state to ApplicantsCatalog?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py

    r8487 r8635  
    2727from zope.securitypolicy.interfaces import IPrincipalRoleManager
    2828from zope.interface import implementedBy
     29from zope.schema.interfaces import RequiredMissing
    2930from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
    3031from waeup.kofa.app import University
     
    111112            return False, _('No course admitted provided.')
    112113        # Add student object
    113         student.firstname = self.firstname
    114         student.lastname = self.lastname
    115         student.sex = self.sex
    116         student.date_of_birth = self.date_of_birth
    117         student.email = self.email
    118         student.phone = self.phone
     114        try:
     115            student.firstname = self.firstname
     116            student.lastname = self.lastname
     117            student.sex = self.sex
     118            student.date_of_birth = self.date_of_birth
     119            student.email = self.email
     120            student.phone = self.phone
     121        except RequiredMissing, err:
     122            return False, _('RequiredMissing: %s' % err)
    119123        site = grok.getSite()
    120124        site['students'].addStudent(student)
     
    180184    reg_number = index.Field(attribute='reg_number')
    181185    email = index.Field(attribute='email')
     186    state = index.Field(attribute='state')
    182187
    183188class ApplicantFactory(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.