Last change
on this file since 1347 was
1345,
checked in by joachim, 18 years ago
|
fix wrong perm_address
|
-
Property svn:keywords set to
Id
|
File size:
1.0 KB
|
Rev | Line | |
---|
[1345] | 1 | ## Script (Python) "search_pins" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters=REQUEST |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id: fixPermAddress.py 1345 2007-01-24 17:31:52Z joachim $ |
---|
| 11 | """ |
---|
| 12 | list Students for ClearanceOfficers |
---|
| 13 | """ |
---|
| 14 | |
---|
| 15 | request = REQUEST |
---|
| 16 | wftool = context.portal_workflow |
---|
| 17 | mtool = context.portal_membership |
---|
| 18 | member = mtool.getAuthenticatedMember() |
---|
| 19 | roles = member.getRolesInContext(context) |
---|
| 20 | retcat = context.returning_import |
---|
| 21 | scat = context.students_catalog |
---|
| 22 | students_folder = context.portal_url.getPortalObject().campus.students |
---|
| 23 | if str(member) not in ('admin','joachim'): |
---|
| 24 | return |
---|
| 25 | count = 0 |
---|
| 26 | #from Products.zdb import set_trace;set_trace() |
---|
| 27 | students = retcat() |
---|
| 28 | for sbrain in students: |
---|
| 29 | sres = scat(matric_no=sbrain.matric_no) |
---|
| 30 | if not sres: |
---|
| 31 | continue |
---|
| 32 | student = getattr(students_folder,sres[0].id,None) |
---|
| 33 | if student is None: |
---|
| 34 | continue |
---|
| 35 | per = getattr(student,'personal',None) |
---|
| 36 | if per is None: |
---|
| 37 | continue |
---|
| 38 | per.getContent().edit(mapping={'perm_address':sbrain.Permanent_Address}) |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | |
---|
Note: See
TracBrowser for help on using the repository browser.