Changeset 7671 for main


Ignore:
Timestamp:
20 Feb 2012, 08:56:44 (13 years ago)
Author:
Henrik Bettermann
Message:

Use workflow state constants instead of strings in students components.

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

Legend:

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

    r7665 r7671  
    14381438
    14391439    def update(self, SUBMIT=None):
    1440         if not self.context.state == 'admitted':
     1440        if not self.context.state == ADMITTED:
    14411441            self.flash("Wrong state.")
    14421442            self.redirect(self.url(self.context))
  • main/waeup.sirp/trunk/src/waeup/sirp/students/student.py

    r7652 r7671  
    2828from waeup.sirp.interfaces import (
    2929    IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler,
    30     ISIRPUtils)
     30    ISIRPUtils, CLEARANCE)
    3131from waeup.sirp.image import SIRPImageFile
    3232from waeup.sirp.imagestorage import DefaultFileStoreHandler
     
    147147    """
    148148    reg_state = IWorkflowState(student).getState()
    149     if reg_state == 'clearance started':
     149    if reg_state == CLEARANCE:
    150150        student.clearance_locked = False
    151151    else:
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r7591 r7671  
    369369    @property
    370370    def target_url(self):
    371         if self.context.state != 'admitted':
     371        if self.context.state != ADMITTED:
    372372            return ''
    373373        return self.view.url(self.view.context, self.target)
     
    384384    @property
    385385    def target_url(self):
    386         if self.context.state != 'admitted':
     386        if self.context.state != ADMITTED:
    387387            return ''
    388388        return self.view.url(self.view.context, self.target)
     
    428428    def target_url(self):
    429429        student = self.view.context.getStudent()
    430         condition1 = student.state != 'school fee paid'
     430        condition1 = student.state != PAID
    431431        condition2 = str(student['studycourse'].current_level) in \
    432432            self.view.context.keys()
     
    446446    def target_url(self):
    447447        student = self.view.context.getStudent()
    448         condition1 = student.state != 'school fee paid'
     448        condition1 = student.state != PAID
    449449        condition2 = student[
    450450            'studycourse'].current_level != self.view.context.level
Note: See TracChangeset for help on using the changeset viewer.