Changeset 2904


Ignore:
Timestamp:
10 Dec 2007, 11:15:53 (17 years ago)
Author:
joachim
Message:

fixes for order_id (don't use yet)

Location:
WAeUP_SRP/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Payment.py

    r2900 r2904  
    3333
    3434    security.declareProtected(View,"updatePayments")
    35     def updatePayments(self):
     35    def updatePayments(self,force = None):
    3636        """upgrade all payments in folder"""
    3737        logger = logging.getLogger('PaymentsFolder.updatePayments')
     
    3939        for payment in self.aq_parent.objectValues():
    4040            student_record = self.students_catalog.getRecordByKey(self.getStudentId())
    41             payment['updatePayment'](student_record)
     41            payment['updatePayment'](student_record,force=force)
    4242
    4343InitializeClass(PaymentsFolder)
     
    7272
    7373    security.declareProtected(View,"updatePayment")
    74     def updatePayment(self,student_record):
     74    def updatePayment(self,student_record,force=None):
    7575        doc = self.getContent()
    76         if getattr(doc,'status',None):
     76        if getattr(doc,'status',None) and not force:
    7777            return
    7878        wftool = self.portal_workflow
     
    9797            p_type = "online"
    9898            p_status = "started"
     99            # don't set order_id it is already correct
     100            if self.order_id.starts_with('p'):
     101                try:
     102                    self.payments_catalog.deleteRecord(self.order_id)
     103                except:
     104                    pass
     105                d['order_id'] = "%s%s" % (student_record.id[1:],self.aq_parent.getId()[1:])
    99106            break
    100107        d['type'] = p_type  # scratch card
     
    104111        d['resp_pay_reference'] = doc.resp_pay_reference
    105112        d['resp_desc'] = doc.resp_desc
    106         d['order_id'] = self.aq_parent.getId()
    107113        d['resp_code'] = doc.resp_code
    108114        d['resp_card_num'] = doc.resp_card_num
  • WAeUP_SRP/base/WAeUPTables.py

    r2897 r2904  
    14491449        mt = getattr(object,'meta_type',None)
    14501450        data = {}
    1451         if pt == 'Payment' and mt == 'CPS Proxy Folder':
    1452             order_id = object.id
     1451        if pt != 'Payment':
     1452            return
     1453        if mt == 'CPS Proxy Folder':
    14531454            if event_type == "sys_add_object":
    1454                 try:
    1455                     self.addRecord(order_id = order_id)
    1456                 except ValueError:
    1457                     pass
    1458                 return
     1455                return # is handled in modify since we don't have order_id yet
     1456                # try:
     1457                #     self.addRecord(order_id = order_id)
     1458                # except ValueError:
     1459                #     pass
     1460                # return
    14591461            elif event_type == 'sys_del_object':
    14601462                self.deleteRecord(order_id)
    1461         if pt != 'Payment' or mt == 'CPS Proxy Folder':
    14621463            return
    14631464        if event_type not in ('sys_modify_object'):
     
    14661467            data[field] = getattr(object,field,'')
    14671468        rpl = infos['rpath'].split('/')
    1468         student_id = rpl[-3]
     1469        #import pdb;pdb.set_trace()
     1470        student_id = rpl[-4]
    14691471        data['student_id'] = student_id
    14701472        try:
Note: See TracChangeset for help on using the changeset viewer.