Ignore:
Timestamp:
25 Apr 2007, 07:22:45 (17 years ago)
Author:
Henrik Bettermann
Message:

make fix faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_utilities/setNewEntryMode.py

    r1704 r1706  
    1 ## Script (Python) "reindex_entry_mode"
     1## Script (Python) "setNewEntryMode"
    22##bind container=container
    33##bind context=context
     
    3232#set_trace()
    3333for brain in brains:
    34     student_path = brain.getPath()
    35     sub_brains = context.portal_catalog(path = student_path)
    36     app_doc = None
    37     sc_doc = None
    38     for sb in sub_brains:
    39         if sb.getId == 'application':
    40             app_doc = sb.getObject().getContent()
    41         elif sb.getId == 'study_course':
    42             sc_doc = sb.getObject().getContent()
    43     if app_doc is None:
     34    stud_obj = brain.getObject()
     35    try:     
     36        app_doc = stud_obj.application.getContent()
     37        try:
     38            sc_doc = stud_obj.study_course.getContent()
     39        except:
     40            sc_doc = None
     41    except:
    4442        continue
    4543    em = getattr(app_doc,'entry_mode',None)
     
    5250    rwrite(s)
    5351rwrite('Done')
     52
     53
Note: See TracChangeset for help on using the changeset viewer.