- Timestamp:
- 10 Dec 2007, 11:15:53 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/Payment.py
r2900 r2904 33 33 34 34 security.declareProtected(View,"updatePayments") 35 def updatePayments(self ):35 def updatePayments(self,force = None): 36 36 """upgrade all payments in folder""" 37 37 logger = logging.getLogger('PaymentsFolder.updatePayments') … … 39 39 for payment in self.aq_parent.objectValues(): 40 40 student_record = self.students_catalog.getRecordByKey(self.getStudentId()) 41 payment['updatePayment'](student_record )41 payment['updatePayment'](student_record,force=force) 42 42 43 43 InitializeClass(PaymentsFolder) … … 72 72 73 73 security.declareProtected(View,"updatePayment") 74 def updatePayment(self,student_record ):74 def updatePayment(self,student_record,force=None): 75 75 doc = self.getContent() 76 if getattr(doc,'status',None) :76 if getattr(doc,'status',None) and not force: 77 77 return 78 78 wftool = self.portal_workflow … … 97 97 p_type = "online" 98 98 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:]) 99 106 break 100 107 d['type'] = p_type # scratch card … … 104 111 d['resp_pay_reference'] = doc.resp_pay_reference 105 112 d['resp_desc'] = doc.resp_desc 106 d['order_id'] = self.aq_parent.getId()107 113 d['resp_code'] = doc.resp_code 108 114 d['resp_card_num'] = doc.resp_card_num -
WAeUP_SRP/base/WAeUPTables.py
r2897 r2904 1449 1449 mt = getattr(object,'meta_type',None) 1450 1450 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': 1453 1454 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 1459 1461 elif event_type == 'sys_del_object': 1460 1462 self.deleteRecord(order_id) 1461 if pt != 'Payment' or mt == 'CPS Proxy Folder':1462 1463 return 1463 1464 if event_type not in ('sys_modify_object'): … … 1466 1467 data[field] = getattr(object,field,'') 1467 1468 rpl = infos['rpath'].split('/') 1468 student_id = rpl[-3] 1469 #import pdb;pdb.set_trace() 1470 student_id = rpl[-4] 1469 1471 data['student_id'] = student_id 1470 1472 try:
Note: See TracChangeset for help on using the changeset viewer.