Ignore:
Timestamp:
4 May 2012, 09:07:18 (13 years ago)
Author:
uli
Message:

Keep indentation flat.

File:
1 edited

Legend:

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

    r8325 r8337  
    7777            # In tests we might not have a site object
    7878            co_enabled = True
    79         if co_enabled and studylevel.level % 100 == 0:
    80             levels = sorted(self.keys())
    81             index = levels.index(str(studylevel.level))
    82             if  index > 0:
    83                 previous_level = self[levels[index-1]]
    84                 for key, val in previous_level.items():
    85                     if val.score < val.passmark:
    86                         if key in self[str(studylevel.level)]:
    87                             # Carry-over ticket exists
    88                             continue
    89                         co_ticket = createObject(u'waeup.CourseTicket')
    90                         for name in ['code', 'title', 'credits', 'passmark',
    91                                      'semester', 'mandatory',
    92                                      'fcode', 'dcode']:
    93                             setattr(co_ticket, name, getattr(val, name))
    94                         co_ticket.automatic = True
    95                         co_ticket.carry_over = True
    96                         self[str(studylevel.level)][co_ticket.code] = co_ticket
     79        if not co_enabled or studylevel.level % 100 != 0:
     80            return
     81        levels = sorted(self.keys())
     82        index = levels.index(str(studylevel.level))
     83        if index <= 0:
     84            return
     85        previous_level = self[levels[index-1]]
     86        for key, val in previous_level.items():
     87            if val.score >= val.passmark:
     88                continue
     89            if key in self[str(studylevel.level)]:
     90                # Carry-over ticket exists
     91                continue
     92            co_ticket = createObject(u'waeup.CourseTicket')
     93            for name in ['code', 'title', 'credits', 'passmark',
     94                         'semester', 'mandatory', 'fcode', 'dcode']:
     95                setattr(co_ticket, name, getattr(val, name))
     96            co_ticket.automatic = True
     97            co_ticket.carry_over = True
     98            self[str(studylevel.level)][co_ticket.code] = co_ticket
    9799        return
    98100
Note: See TracChangeset for help on using the changeset viewer.