Ignore:
Timestamp:
31 May 2016, 17:57:03 (8 years ago)
Author:
Henrik Bettermann
Message:

Make some adjustments to payment exporters and importers: Do not allow to import display_item, use IPayer adapter, fix docstring and more.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r13024 r13871  
    4545    IStudentStudyLevel, ICourseTicketImport,
    4646    IStudentOnlinePayment, IStudentVerdictUpdate)
     47from waeup.kofa.payments.interfaces import IPayer
    4748from waeup.kofa.students.workflow import  (
    4849    IMPORTABLE_STATES, IMPORTABLE_TRANSITIONS,
     
    735736
    736737class StudentOnlinePaymentProcessor(StudentProcessorBase):
    737     """The Course Ticket Processor imports student payment tickets. The
    738     tickets are located in the ``payments`` subfolder of the student
     738    """The Student Online Payment Processor imports student payment tickets.
     739    The tickets are located in the ``payments`` subfolder of the student
    739740    container. The only additional locator is `p_id`, the object id.
    740741
     
    759760
    760761    additional_fields = ['p_id']
     762
     763    @property
     764    def available_fields(self):
     765        af = super(
     766            StudentOnlinePaymentProcessor, self).available_fields
     767        af.remove('display_item')
     768        return af
    761769
    762770    def checkHeaders(self, headerfields, mode='ignore'):
     
    875883            results = list(cat.searchResults(p_id=(p_id, p_id)))
    876884            if len(results) > 0:
    877                 sids = [payment.student.student_id for payment in results]
     885                sids = [IPayer(payment).id for payment in results]
    878886                sids_string = ''
    879887                for id in sids:
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r13766 r13871  
    382382        sorted(iface_names(
    383383            IStudentOnlinePayment, exclude_attribs=False,
    384             omit=['display_item', 'certificate']))) + (
     384            omit=['display_item', 'certificate', 'student']))) + (
    385385            'student_id','state','current_session')
    386386    title = _(u'Student Payments')
     
    430430        sorted(iface_names(
    431431            IStudentOnlinePayment, exclude_attribs=False,
    432             omit=['display_item', 'certificate']))) + (
     432            omit=['display_item', 'certificate', 'student']))) + (
    433433            'student_id','matric_number','reg_number',
    434434            'firstname', 'middlename', 'lastname',
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r13736 r13871  
    773773
    774774    certificate = Attribute('Certificate to determine the correct p_level value')
     775    student = Attribute('Student')
    775776
    776777    p_current = schema.Bool(
     
    785786        required = False,
    786787        )
     788
     789    def redeemTicket():
     790        """Either create an appropriate access code or trigger an action
     791        directly.
     792        """
    787793
    788794    def doAfterStudentPayment():
Note: See TracChangeset for help on using the changeset viewer.