Ignore:
Timestamp:
10 Sep 2012, 11:05:07 (12 years ago)
Author:
uli
Message:

Merge changes from trunk, r8786-HEAD

Location:
main/waeup.kofa/branches/uli-async-update
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-async-update

  • main/waeup.kofa/branches/uli-async-update/src/waeup/kofa/applicants/browser.py

    r9166 r9169  
    309309    pnav = 3
    310310
    311     form_fields = grok.AutoFields(IApplicantsContainer).omit('title')
    312     form_fields['description'].custom_widget = HTMLDisplayWidget
    313     form_fields[
    314         'startdate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    315     form_fields[
    316         'enddate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     311    @property
     312    def form_fields(self):
     313        form_fields = grok.AutoFields(IApplicantsContainer).omit('title')
     314        form_fields['description'].custom_widget = HTMLDisplayWidget
     315        form_fields[
     316            'startdate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     317        form_fields[
     318            'enddate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     319        if self.request.principal.id == 'zope.anybody':
     320            form_fields = form_fields.omit(
     321                'code', 'prefix', 'year', 'mode',
     322                'strict_deadline', 'application_category')
     323        return form_fields
    317324
    318325    @property
     
    494501    grok.template('applicantdisplaypage')
    495502    form_fields = grok.AutoFields(IApplicant).omit(
    496         'locked', 'course_admitted', 'password')
     503        'locked', 'course_admitted', 'password', 'suspended')
    497504    label = _('Applicant')
    498505    pnav = 3
     506    hide_hint = False
    499507
    500508    @property
     
    539547    grok.name('base')
    540548    form_fields = grok.AutoFields(IApplicant).select(
    541         'applicant_id', 'firstname', 'lastname','email', 'course1')
     549        'applicant_id','email', 'course1')
    542550
    543551class CreateStudentPage(UtilityView, grok.View):
     
    708716
    709717    def update(self):
    710         if self.context.state in ('initialized', 'started'):
     718        if self.context.state in ('initialized', 'started', 'paid'):
    711719            self.flash(
    712                 _('Please pay before trying to download the application slip.'))
     720                _('Please pay and submit before trying to download the application slip.'))
    713721            return self.redirect(self.url(self.context))
    714722        return
     
    882890    form_fields = grok.AutoFields(IApplicantEdit).omit(
    883891        'locked', 'course_admitted', 'student_id',
    884         'screening_score',
     892        'suspended'
    885893        )
    886894    form_fields['applicant_id'].for_display = True
     
    10851093        # Send email with credentials
    10861094        login_url = self.url(grok.getSite(), 'login')
     1095        url_info = u'Login: %s' % login_url
    10871096        msg = _('You have successfully been registered for the')
    10881097        if kofa_utils.sendCredentials(IUserAccount(applicant),
    1089             password, login_url, msg):
     1098            password, url_info, msg):
    10901099            email_sent = applicant.email
    10911100        else:
Note: See TracChangeset for help on using the changeset viewer.