source: WAeUP_SRP/trunk/skins/waeup_utilities/ti_361_resolve.py @ 4331

Last change on this file since 4331 was 2339, checked in by Henrik Bettermann, 17 years ago

see ticket #361

File size: 1.4 KB
Line 
1## Script (Python) "ti_361_resolve"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: ti_361_resolve.py 2179 2007-09-05 14:03:29Z henrik $
11"""
12"""
13try:
14    from Products.zdb import set_trace
15except:
16    def set_trace():
17        pass
18
19mtool = context.portal_membership
20member = mtool.getAuthenticatedMember()
21if str(member) not in ('admin','joachim'):
22    return
23
24
25import logging
26import DateTime
27logger = logging.getLogger('Skins.ti_339_resolve')
28from Products.AdvancedQuery import Eq, Between, Le,In
29applicants = context.applicants_catalog
30
31request = context.REQUEST
32session = request.SESSION
33response = request.RESPONSE
34setheader = request.RESPONSE.setHeader
35def rwrite(s):
36    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
37    response.write("%s<br>\n\r" % s)
38
39#logger.info('')
40
41brains = applicants()
42total = len(brains)
43edited = 0
44for brain in brains:
45    if brain.screening_type == 'PUME':
46        data = {}
47        data['reg_no'] = brain.reg_no
48        data['screening_type'] = 'pume'
49        applicants.modifyRecord(**data)
50        edited += 1
51        #rwrite('%d: %s,%s,%s' % (edited,
52        #                            brain.reg_no,
53        #                            brain.status,
54        #                            brain.email)
55        #      )
56logger.info("edited %d students" % (edited))
Note: See TracBrowser for help on using the repository browser.