Ignore:
Timestamp:
29 Apr 2012, 19:47:24 (13 years ago)
Author:
Henrik Bettermann
Message:

Remove entry_level attribute. The entry level is given by the start level of the study course admitted.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
6 edited

Legend:

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

    r8286 r8311  
    3232    IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, IKofaUtils,
    3333    IExtFileStore, IPDF, IUserAccount)
     34from waeup.kofa.interfaces import MessageFactory as _
    3435from waeup.kofa.students.vocabularies import RegNumNotInSource
    3536from waeup.kofa.utils.helpers import attrs_to_fields
     
    8081
    8182    def createStudent(self, view=None):
    82         """Create a student, fill with base data, create a StudentApplication
    83         object and copy applicant data.
     83        """Create a student, fill with base data, create an application slip
     84        and copy applicant data.
    8485        """
    8586        # Is applicant in the correct state?
    8687        if self.state != 'admitted':
    87             return False, "Applicant has not yet been admitted."
     88            return False, _('Applicant has not yet been admitted.')
    8889        # Does registration number exist?
    8990        student = createObject(u'waeup.Student')
     
    9192            student.reg_number = self.reg_number
    9293        except RegNumNotInSource:
    93             return False, 'Registration Number exists.'
     94            return False, _('Registration Number exists.')
    9495        # Has the course_admitted field been properly filled?
    9596        if self.course_admitted is None:
    96             return False, 'No course admitted provided.'
     97            return False, _('No course admitted provided.')
    9798        # Add student object
    9899        student.firstname = self.firstname
     
    114115        student['studycourse'].entry_session = self.__parent__.year
    115116        student['studycourse'].current_session = self.__parent__.year
    116         student['studycourse'].current_level = self.__parent__.entry_level
     117        student['studycourse'].current_level = self.course_admitted.start_level
    117118        self._copyPassportImage(student)
    118119        # Update the catalog
     
    122123        self._createApplicationPDF(student, view=view)
    123124
    124         return True, 'Student %s created' % student.student_id
     125        return True, _('Student %s created') % student.student_id
    125126
    126127    def _createApplicationPDF(self, student, view=None):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py

    r8057 r8311  
    3333
    3434    #: Fieldnames considered by this exporter
    35     fields = ('code', 'title', 'prefix', 'entry_level', 'year',
     35    fields = ('code', 'title', 'prefix', 'year',
    3636              'application_category', 'description',
    3737              'startdate', 'enddate', 'strict_deadline')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r8286 r8311  
    188188        )
    189189
    190     entry_level = schema.Choice(
    191         title = _(u'Entry Level'),
    192         vocabulary = course_levels,
    193         required = True,
    194         )
    195 
    196190    # Maybe Uniben still needs this ...
    197191    #ac_prefix = schema.Choice(
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py

    r8291 r8311  
    153153        self.assertEqual(container.title, u'General Studies 2012/2013')
    154154        self.assertEqual(container.prefix, u'app')
    155         self.assertEqual(container.entry_level, 100)
    156155        self.assertEqual(container.year, 2012)
    157156        self.assertEqual(container.application_category, 'basic')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8286 r8311  
    8686        applicantscontainer.prefix = 'app'
    8787        applicantscontainer.year = 2009
    88         applicantscontainer.entry_level = 100
    8988        applicantscontainer.application_category = 'basic'
    9089        applicantscontainer.mode = 'create'
     
    251250        self.browser.getControl(name="form.prefix").value = ['app']
    252251        self.browser.getControl(name="form.year").value = ['2010']
    253         self.browser.getControl(name="form.entry_level").value = ['100']
    254252        self.browser.getControl(name="form.mode").value = ['create']
    255253        self.browser.getControl(
     
    266264        self.browser.getControl(name="form.prefix").value = ['app']
    267265        self.browser.getControl(name="form.year").value = ['2010']
    268         self.browser.getControl(name="form.entry_level").value = ['100']
    269266        self.browser.getControl(name="form.mode").value = ['create']
    270267        self.browser.getControl(
     
    281278        self.browser.getControl(name="form.prefix").value = ['app']
    282279        self.browser.getControl(name="form.year").value = ['2010']
    283         self.browser.getControl(name="form.entry_level").value = ['100']
    284280        self.browser.getControl(name="form.mode").value = ['create']
    285281        #self.browser.getControl(name="form.ac_prefix").value = ['APP']
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r8286 r8311  
    5353        container.prefix = list(ApplicationTypeSource()(container))[0]
    5454        container.year = 2012
    55         container.entry_level = 100
    5655        container.application_category = list(AppCatSource()(container))[0]
    5756        container.description = u'Some Description\nwith linebreak\n'
     
    7271        self.assertEqual(
    7372            result,
    74             'code,title,prefix,entry_level,year,application_category,'
     73            'code,title,prefix,year,application_category,'
    7574            'description,startdate,enddate,strict_deadline\r\n'
    7675
    77             'dp2012,General Studies 2012/13,app,100,2012,basic,'
     76            'dp2012,General Studies 2012/13,app,2012,basic,'
    7877            '"Some Description\nwith linebreak\n<<de>>man spriht deutsh",'
    7978            '2012-01-01 12:00:00+00:00,2012-01-31 23:00:00+00:00,1\r\n'
Note: See TracChangeset for help on using the changeset viewer.