Ignore:
Timestamp:
30 Jan 2012, 11:26:01 (13 years ago)
Author:
Henrik Bettermann
Message:

Lock CourseTicketAddFormPage2 if not in state school fee paid.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7538 r7539  
    5757    )
    5858from waeup.sirp.students.catalog import search
    59 from waeup.sirp.students.workflow import (
     59from waeup.sirp.students.workflow import (ADMITTED, PAID,
    6060    CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED)
    6161from waeup.sirp.students.studylevel import StudentStudyLevel, CourseTicket
     
    17481748
    17491749    def update(self):
    1750         if self.context.getStudent().state != 'admitted':
     1750        if self.context.getStudent().state != ADMITTED:
    17511751            emit_lock_message(self)
    17521752            return
     
    20212021
    20222022    def update(self):
    2023         if self.context.getStudent().state != 'school fee paid':
     2023        if self.context.getStudent().state != PAID:
    20242024            emit_lock_message(self)
    20252025            return
     
    20702070
    20712071    def update(self):
     2072        if self.context.getStudent().state != PAID:
     2073            emit_lock_message(self)
     2074            return
    20722075        super(StudyLevelEditFormPage, self).update()
    20732076        datatable.need()
     
    21312134        'grade', 'score', 'core_or_elective', 'automatic')
    21322135
     2136    def update(self):
     2137        if self.context.getStudent().state != PAID:
     2138            emit_lock_message(self)
     2139            return
     2140        super(CourseTicketAddFormPage2, self).update()
     2141        return
     2142
    21332143    @action('Add course ticket')
    21342144    def addCourseTicket(self, **data):
     2145        # Double bottom ...
     2146        if self.context.getStudent().state != PAID:
     2147            return
    21352148        ticket = CourseTicket()
    21362149        course = data['course']
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7521 r7539  
    399399        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    400400        self.assertEqual(self.browser.url, self.personal_student_path)
    401         self.browser.getLink("Manage").click()
     401        self.browser.getLink("Edit").click()
    402402        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    403403        self.assertEqual(self.browser.url, self.edit_personal_student_path)
Note: See TracChangeset for help on using the changeset viewer.