Ignore:
Timestamp:
2 Dec 2016, 10:34:05 (8 years ago)
Author:
Henrik Bettermann
Message:

Add 'certificate request' components.

File:
1 edited

Legend:

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

    r14228 r14304  
    4949    ICustomUGApplicantEdit,
    5050    ITranscriptApplicant,
     51    ICertificateRequest,
    5152    ICustomApplicant
    5253    )
     
    230231            form_fields['perm_address'].custom_widget = BytesDisplayWidget
    231232            return form_fields
     233        if self.target is not None and self.target == 'cert':
     234            form_fields = grok.AutoFields(ICertificateRequest).omit(
     235                'locked', 'suspended')
     236            form_fields['dispatch_address'].custom_widget = BytesDisplayWidget
     237            form_fields['perm_address'].custom_widget = BytesDisplayWidget
     238            return form_fields
    232239        # AAUE is using the same interface for all regular applications.
    233240        form_fields = grok.AutoFields(ICustomUGApplicant)
     
    261268    def target_url(self):
    262269        if self.context.state in ('initialized', 'started', 'paid') \
    263             or self.context.special or self.view.target == 'trans':
     270            or self.context.special or self.view.target in ('trans', 'cert'):
    264271            return
    265272        return self.view.url(self.view.context, self.target)
     
    337344            form_fields['applicant_id'].for_display = True
    338345            return form_fields
     346        if self.target is not None and self.target == 'cert':
     347            form_fields = grok.AutoFields(ICertificateRequest)
     348            form_fields['applicant_id'].for_display = True
     349            return form_fields
    339350        # AAUE is using the same interface for all regular applications.
    340351        form_fields = grok.AutoFields(ICustomUGApplicant)
     
    358369    """An applicant-centered edit view for applicant data.
    359370    """
    360 
    361     grok.template('applicanteditpage')
    362371
    363372    def unremovable(self, ticket):
     
    388397        if self.target is not None and self.target == 'trans':
    389398            form_fields = grok.AutoFields(ITranscriptApplicant).omit(
     399                'locked', 'suspended')
     400            form_fields['applicant_id'].for_display = True
     401            return form_fields
     402        if self.target is not None and self.target == 'cert':
     403            form_fields = grok.AutoFields(ICertificateRequest).omit(
    390404                'locked', 'suspended')
    391405            form_fields['applicant_id'].for_display = True
Note: See TracChangeset for help on using the changeset viewer.