Ignore:
Timestamp:
13 Sep 2011, 15:46:34 (13 years ago)
Author:
Henrik Bettermann
Message:

Avoid overkill during batch creation of students.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/student.py

    r6704 r6749  
    1919import grok
    2020from grok import index
    21 from zope.component.interfaces import IFactory, ComponentLookupError
     21from zope.component.interfaces import IFactory
    2222from zope.interface import implementedBy
    2323from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
     
    4040        super(Student, self).__init__()
    4141        IWorkflowInfo(self).fireTransition('create')
    42         # The catalog doesn't exist in unit tests
     42        # The site doesn't exist in unit tests
    4343        try:
    44             self.student_id = generate_student_id('?')
    45         except ComponentLookupError:
     44            students = grok.getSite()['students']
     45            self.student_id = generate_student_id(students,'?')
     46        except TypeError:
    4647            self.student_id = u'Z654321'
    4748        self.password = None
Note: See TracChangeset for help on using the changeset viewer.