Ignore:
Timestamp:
15 May 2012, 20:29:34 (13 years ago)
Author:
Henrik Bettermann
Message:

Applicants must not trigger the the approve transition which lead to wrong history message.

Distinguish between payment approval and regular payment in log files too.

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

Legend:

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

    r8422 r8453  
    523523        """
    524524
     525    def doAfterApplicantPaymentApproval():
     526        """Process applicant after payment was approved.
     527
     528        """
     529
    525530    def approveApplicantPayment():
    526531        """Approve payment and process applicant.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py

    r8434 r8453  
    4040        return
    4141
     42    def doAfterApplicantPaymentApproval(self):
     43        """Process applicant after payment was approved.
     44        """
     45        wf_info = IWorkflowInfo(self.__parent__)
     46        try:
     47            wf_info.fireTransition('approve')
     48        except InvalidTransitionError:
     49            msg = log = 'Error: %s' % sys.exc_info()[1]
     50            return False, msg, log
     51        log = 'payment approved: %s' % self.p_id
     52        msg = _('Payment approved')
     53        return False, msg, log
     54
    4255    def doAfterApplicantPayment(self):
    4356        """Process applicant after payment was made.
     
    4558        wf_info = IWorkflowInfo(self.__parent__)
    4659        try:
    47             wf_info.fireTransition('approve')
     60            wf_info.fireTransition('pay')
    4861        except InvalidTransitionError:
    4962            msg = log = 'Error: %s' % sys.exc_info()[1]
     
    5972            return False, _('This ticket has already been paid.'), None
    6073        self.approve()
    61         return self.doAfterApplicantPayment()
     74        return self.doAfterApplicantPaymentApproval()
    6275
    6376ApplicantOnlinePayment = attrs_to_fields(ApplicantOnlinePayment)
Note: See TracChangeset for help on using the changeset viewer.