Ignore:
Timestamp:
24 Jan 2020, 12:58:03 (5 years ago)
Author:
Henrik Bettermann
Message:

Add trans_id field.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/applicants
Files:
3 edited

Legend:

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

    r15950 r15951  
    2828    IPUTMEApplicantEdit, ITranscriptApplicant, ICertificateRequest,
    2929    IFedexRequest)
    30 
    31 @grok.subscribe(ICustomApplicant, grok.IObjectRemovedEvent)
    32 def custom_handle_applicant_removed(applicant, event):
    33     """If an applicant is removed also pdf files of this applicant are removed.
    34     """
    35     file_store = getUtility(IExtFileStore)
    36     file_store.deleteFileByContext(applicant, attr='stateresult.pdf')
    37     file_store.deleteFileByContext(applicant, attr='verificationdoc.pdf')
    38     return
    3930
    4031class CustomApplicant(NigeriaApplicant):
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py

    r15950 r15951  
    2222from zope.component import getUtility, getAdapter
    2323from zope.i18n import translate
     24from zope.catalog.interfaces import ICatalog
    2425from hurry.workflow.interfaces import IWorkflowState
    2526from waeup.kofa.interfaces import (
     
    3334from waeup.kofa.applicants.viewlets import PDFActionButton
    3435from waeup.kofa.applicants.interfaces import IApplicantRegisterUpdate
    35 from waeup.kofa.browser.layout import UtilityView
     36from waeup.kofa.browser.layout import UtilityView, action
    3637from waeup.kofa.students.interfaces import IStudentsUtils
    3738from waeup.kofa.interfaces import IPDF
     
    572573        return form_fields
    573574
     575    @action(_('Save'), style='primary')
     576    def save(self, **data):
     577        if self.upload_success is False:  # False is not None!
     578            # Error during image upload. Ignore other values.
     579            return
     580        if self.target == 'fedex':
     581            cat = getUtility(ICatalog, name='applicants_catalog')
     582            results = list(cat.searchResults(
     583                applicant_id=(data['trans_id'], data['trans_id'])))
     584            if not results:
     585                self.flash(_('The transcript application id does not exist.'),
     586                           type='danger')
     587                return
     588        self.applyData(self.context, **data)
     589        self.flash(_('Form has been saved.'))
     590        return
     591
    574592    def update(self):
    575593        if self.context.locked or (
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py

    r15950 r15951  
    563563
    564564    applicant_id = schema.TextLine(
    565         title = _(u'Applicant Id'),
     565        title = _(u'Application Id'),
    566566        required = False,
    567567        readonly = False,
     
    722722
    723723    applicant_id = schema.TextLine(
    724         title = _(u'Applicant Id'),
     724        title = _(u'Application Id'),
    725725        required = False,
    726726        readonly = False,
     
    837837
    838838    applicant_id = schema.TextLine(
    839         title = _(u'Applicant Id'),
     839        title = _(u'Application Id'),
    840840        required = False,
    841841        readonly = False,
     
    916916
    917917    applicant_id = schema.TextLine(
    918         title = _(u'Applicant Id'),
    919         required = False,
     918        title = _(u'Application Id'),
     919        required = False,
     920        readonly = False,
     921        )
     922
     923    trans_id = schema.TextLine(
     924        title = _(u'Id of Transcript Application'),
     925        required = True,
    920926        readonly = False,
    921927        )
     
    10521058class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant,
    10531059                       ITranscriptApplicant, ICertificateRequest,
    1054                        IVerificationRequest, ISendByEmailRequest):
     1060                       IVerificationRequest, ISendByEmailRequest,
     1061                       IFedexRequest):
    10551062    """An interface for all types of applicants.
    10561063
Note: See TracChangeset for help on using the changeset viewer.