- Timestamp:
- 24 Jan 2015, 09:27:40 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r12469 r12513 5 5 ======================= 6 6 7 * No changes yet. 7 * Check if p_id exists in payments_catalog when importing payment tickets in 8 create mode. 8 9 9 10 -
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r12180 r12513 793 793 errs.append(('p_id','invalid format')) 794 794 return errs, inv_errs, conv_dict 795 # Requirement added on 24/01/2015: p_id must be portal-wide unique. 796 if mode == 'create': 797 cat = getUtility(ICatalog, name='payments_catalog') 798 results = list(cat.searchResults(p_id=(p_id, p_id))) 799 if len(results) > 0: 800 sids = [payment.student.student_id for payment in results] 801 sids_string = '' 802 for id in sids: 803 sids_string += '%s ' % id 804 errs.append(('p_id','p_id exists in %s' % sids_string)) 805 return errs, inv_errs, conv_dict 795 806 return errs, inv_errs, conv_dict 796 807 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r12415 r12513 288 288 # XXX: there is no addPayment method to give predictable names 289 289 self.payment = student['payments']['my-payment'] = payment 290 notify(grok.ObjectModifiedEvent(self.payment)) 290 291 return payment 291 292 … … 1065 1066 dict(p_id=p_id)) 1066 1067 self.assertEqual(len(errs),0) 1068 dup_payment = createObject(u'waeup.StudentOnlinePayment') 1069 dup_payment.p_id = 'XYZ-99-1234567890' 1070 self.student['payments'][dup_payment.p_id] = dup_payment 1071 errs, inv_errs, conv_dict = self.processor.checkConversion( 1072 dict(p_id='XYZ-99-1234567890'), mode='create') 1073 self.assertEqual(len(errs),1) 1074 self.assertEqual(errs[0], ('p_id', u'p_id exists in K1000000 ')) 1067 1075 1068 1076 def test_import(self): -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r12414 r12513 183 183 184 184 def getEntry(self, row, site): 185 """Get the parentobject for the entry in ``row``.185 """Get the object for the entry in ``row``. 186 186 """ 187 187 raise NotImplementedError('method not implemented')
Note: See TracChangeset for help on using the changeset viewer.