Changeset 1571


Ignore:
Timestamp:
17 Mar 2007, 15:25:56 (18 years ago)
Author:
Henrik Bettermann
Message:

new logging format Part 4 (rest)

Location:
WAeUP_SRP/trunk
Files:
2 added
1 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r1146 r1571  
    5151    def importLocalRoles(self,portal_type): ###(
    5252        name = '%sLocalRoles' % portal_type
    53         logger = logging.getLogger('Import.%s' % name)
     53        logger = logging.getLogger('Academics.AcademicsFolder.importLocalRoles')
    5454        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    5555        logger.info('Start importing %(name)s to %(name)s_%(current)s.csv' % vars())
     
    7474                        member_id = r.split(':')[1]
    7575                        odict[obj_id].manage_setLocalRoles(member_id, roles_dict[r])
    76                         logger.info('importing role for %s %s %s' % (obj_id, member_id,roles_dict[r]))
     76                        logger.info('Importing role for %s %s %s' % (obj_id, member_id,roles_dict[r]))
    7777
    7878###)
     
    8787        name = 'Faculties'
    8888        no_import = False
    89         logger = logging.getLogger('Import.%s_csv' % name)
     89        logger = logging.getLogger('Academics.AcademicsFolder.loadFacultiesFromCSV')
    9090        logger.info('Start loading from %s.csv' % name)
    9191        academics = self.portal_catalog({'meta_type': 'AcademicsFolder'})[-1].getObject()
     
    134134        name = 'Departments'
    135135        no_import = False
    136         logger = logging.getLogger('Import.Departments')
     136        logger = logging.getLogger('Academics.AcademicsFolder.loadDepartmentsFromCSV')
    137137        fields = ("code",
    138138                  "review_state",
     
    191191        name = 'Courses'
    192192        no_import = False
    193         logger = logging.getLogger('Import.Courses')
     193        logger = logging.getLogger('Academics.AcademicsFolder.loadCoursesFromCSV')
    194194        fields = ("code",
    195195                  "review_state",
     
    296296        wf = self.portal_workflow
    297297        no_import_list = []
    298         logger = logging.getLogger('Import.Certificates')
     298        logger = logging.getLogger('Academics.AcademicsFolder.loadCertificatesFromCSV')
    299299        fields = ("code",
    300300                  "review_state",
     
    374374        """install Certificate Courses from CSV values"""
    375375        #return
    376         logger = logging.getLogger('Import.CertificateCourses')
     376        logger = logging.getLogger('Academics.AcademicsFolder.loadCertificateCoursesFromCSV')
    377377        name = 'CertificateCourses'
    378378        wf = self.portal_workflow
    379379        no_import_list = []
    380         logger = logging.getLogger('Import.CertificateCourses')
    381380        fields = ("code",
    382381                  "review_state",
     
    446445                continue
    447446            l.invokeFactory('CertificateCourse',course_code)
    448             logger.info('Creating CertificateCourse %(code)s in certificate %(certificate_code)s Level %(level)s' % cert_course)
     447            logger.info('Creating CertificateCourse %(code)s in Certificate %(certificate_code)s StudyLevel %(level)s' % cert_course)
    449448            cc = getattr(l,course_code)
    450449            semester = 'first'
     
    492491    def exportLocalRoles(self,portal_type): ###(
    493492        name = '%sLocalRoles' % portal_type
    494         logger = logging.getLogger('Export.%s' % name)
     493        logger = logging.getLogger('Academics.AcademicsFolder.exportLocalRoles')
    495494        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    496495        logger.info('Start exporting %(name)s to %(name)s_%(current)s.csv' % vars())
     
    505504            for (groupname, roles) in obj.get_local_group_roles():
    506505                lr[ 'group:' + group ] = [x for x in roles]
    507             logger.info('exporting %s %s ' % (obj.id, lr))
     506            logger.info('Exporting %s %s ' % (obj.id, lr))
    508507            export.append('"%s","%s"' % (obj.getId(),lr))
    509508        open("%s/import/%s-%s.csv" % (i_home,name,current),"w+").write('\n'.join(export))
     
    519518        name = 'Faculties'
    520519        no_import = False
    521         logger = logging.getLogger('Export.%s' % name)
     520        logger = logging.getLogger('Academics.AcademicsFolder.exportFacultiesToCSV')
    522521        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    523522        logger.info('Start exporting %(name)s to %(name)s_%(current)s.csv' % vars())
     
    526525        export.append('"code","review_state","title","title_prefix","college_code","degree_grade","bank_code"')
    527526        for obj in objects:
    528             logger.info('exporting %s %s ' % (obj.id, obj.title))
     527            logger.info('Exporting %s %s ' % (obj.id, obj.title))
    529528            obj_d = obj.getContent()
    530529            di = {}
     
    552551        name = 'Departments'
    553552        no_import = False
    554         logger = logging.getLogger('Export.%s' % name)
     553        logger = logging.getLogger('Academics.AcademicsFolder.exportDepartmentsToCSV')
    555554        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    556555        logger.info('Start exporting %(name)s to %(name)s_%(current)s.csv' % vars())
     
    570569                    di['review_state'] = self.portal_workflow.getInfoFor(department,'review_state','no_state')
    571570                    export.append('"%(code)s","%(review_state)s","%(title)s","%(title_prefix)s","%(faculty_code)s"' % di)
    572                     logger.info('exporting %s %s ' % (department.id, department.title))
     571                    logger.info('Exporting %s %s ' % (department.id, department.title))
    573572                except:
    574573                    logger.info('could not export %s %s ' % (department.id, department.title))
     
    584583        name = 'Courses'
    585584        no_import = False
    586         logger = logging.getLogger('Export.%s' % name)
     585        logger = logging.getLogger('Academics.AcademicsFolder.exportCoursesToCSV')
    587586        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    588587        logger.info('Start exporting %(name)s to %(name)s_%(current)s.csv' % vars())
     
    614613                    di['review_state'] = self.portal_workflow.getInfoFor(course,'review_state','no_state')
    615614                    export.append(dataline % di)
    616                     logger.info('exporting %s %s ' % (course.id, course.title))
     615                    logger.info('Exporting %s %s ' % (course.id, course.title))
    617616                    continue
    618617        open("%s/import/%s-%s.csv" % (i_home,name,current),"w+").write('\n'.join(export))
     
    626625        name = 'Certificates'
    627626        no_import = False
    628         logger = logging.getLogger('Export.%s' % name)
     627        logger = logging.getLogger('Academics.AcademicsFolder.exportCertificatesToCSV')
    629628        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    630629        logger.info('Start exporting %(name)s to %(name)s_%(current)s.csv' % vars())
     
    668667                    try:
    669668                        export.append(dataline % di)
    670                         logger.info('exporting %s %s ' % (certificate.id, certificate.title))
     669                        logger.info('Exporting %s %s ' % (certificate.id, certificate.title))
    671670                    except:
    672671                        logger.info('could not export %s %s ' % (certificate.id, certificate.title))
     
    682681        name = 'CertificateCourses'
    683682        no_import = False
    684         logger = logging.getLogger('Export.%s' % name)
     683        logger = logging.getLogger('Academics.AcademicsFolder.exportCertificateCoursesToCSV')
    685684        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    686685        logger.info('Start exporting %(name)s to %(name)s_%(current)s.csv' % vars())
     
    714713                                    try:
    715714                                        export.append(dataline % di)
    716                                         logger.info('exporting %s %s ' % (certificate.id, certificate.title))
     715                                        logger.info('Exporting %s %s ' % (certificate.id, certificate.title))
    717716                                    except:
    718                                         logger.info('could not export %s %s ' % (certificate.id, certificate.title))
     717                                        logger.info('Could not export %s %s ' % (certificate.id, certificate.title))
    719718                                        continue
    720719        open("%s/import/%s-%s.csv" % (i_home,name,current),"w+").write('\n'.join(export))
  • WAeUP_SRP/trunk/Accommodation.py

    r1449 r1571  
    107107        no_import = []
    108108        imported = []
    109         logger = logging.getLogger('Import.%s' % name)
     109        logger = logging.getLogger('Accommodation.AccoFolder.importReservedBeds')
    110110        try:
    111111            beds = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    169169                    no_import.append( format_error % bed)
    170170                    continue
    171                 halls[hall] = hall_doc = hall_object.getContent() 
     171                halls[hall] = hall_doc = hall_object.getContent()
    172172            bid = "%(hall)s_%(block)s_%(room)s_%(bed)s" % bed
    173173            res = accommodation(bed = bid)
     
    201201                    acco_doc.edit(mapping={'bed': bid})
    202202                    member = self.portal_membership.getAuthenticatedMember()
    203                     logger.info('"%s","changed reserved bed %s for","%s"' % (member,bid,sid))
     203                    logger.info('%s changed reserved bed %s for %s' % (member,bid,sid))
    204204            accommodation.modifyRecord(bed = bid, student = sid)
    205205            imported.append( format % bed)
     
    227227        return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    228228
    229        
     229
    230230InitializeClass(AccoFolder)
    231231
     
    256256InitializeClass(AccoHall)
    257257
    258    
     258
    259259def addAccoHall(container, id, REQUEST=None, **kw):
    260260    """Add a AccoHall."""
  • WAeUP_SRP/trunk/ScratchCards.py

    r1395 r1571  
    3737        """import PinBatch"""
    3838        name = "PINS"
    39         logger = logging.getLogger('Import.%s' % name)
     39        logger = logging.getLogger('Students.ScratchCardBatchesFolder.importPinBatch')
    4040        logger.info('Start loading from %s.csv' % name)
    4141        pins_section = self.portal_url.getPortalObject().campus.pins
     
    6666            dict['no_of_pins'] = n - 1
    6767            batch.getContent().edit(mapping=dict)
    68             logger.info('Added %s with %d Pins' % (bid,n-1))
     68            logger.info('%s with %d PINs added' % (bid,n-1))
    6969        return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    7070    ###)
     
    140140            return unused[-max_pins:]
    141141        return unused
    142    
     142
    143143    security.declareProtected(View,"getUsedPins")
    144144    def getUsedPins(self):
  • WAeUP_SRP/trunk/Students.py

    r1529 r1571  
    8282    security = ClassSecurityInfo()
    8383
    84     security.declareProtected(ModifyPortalContent,"loadFullTimeStudentsFromCSV")###(
    85     def loadFullTimeStudentsFromCSV(self):
    86         """load Fulltime Studentdata from CSV values"""
    87         import transaction
    88         import random
    89         tr_count = 0
    90         name = 'short_full_time'
    91         no_import = False
    92         if not no_import:
    93             no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
    94             no_import.write('"MatricNo","EntryRegNo","CurrentSession","StudentLevel","fullname","FirstName","MiddleName","Lastname","FormerSurname","Sex","Nationality","State","LGA","PermanentAddress","PermanentAddressCity","CampusAddress","PhoneNumber","Emailaddress","Mode","CourseMajor","Faculty","Dept"\n')
    95         logger = logging.getLogger('Import.%s' % name)
    96         logger.info('Start loading from %s.csv' % name)
    97         pwlist  = []
    98         pwlist.append('"student_id","firstname","middlename","lastname","matric_no","jamb_reg_no","access_code"')
    99         pwl_template = Template('"$student_id","$firstname","$middlename","$lastname","$matric_no","$jamb_reg_no","$access_code"')
    100         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
    101         try:
    102             students = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
    103         except:
    104             logger.error('Error reading %s.csv' % name)
    105             return
    106         l = self.portal_catalog({'meta_type': "StudentClearance",})
    107         matrics = []
    108         for s in l:
    109             matrics.append(s.getObject().getContent().matric_no)
    110         print matrics
    111         l = self.portal_catalog({'meta_type': "Certificate"})
    112         certs = {}
    113         for c in l:
    114             ca,ac,fa,dep_id,co,certcode = c.relative_path.split('/')
    115             cid = "%(dep_id)s_%(certcode)s" % vars()
    116             certs[cid] = c.getObject()
    117         for student in students:
    118             logger.info('processing "%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
    119             sid = student.get('MatricNo')
    120             if sid == "":
    121                 em = 'Empty MatricNo\n'
    122                 logger.info(em)
    123                 no_import.write(em)
    124                 no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
    125                 continue
    126             certcode = makeCertificateCode(student.get('CourseMajor'))
    127             dep_id = student.get('Dept')
    128             fac_id = student.get('Faculty')
    129             cid = "%(dep_id)s_%(certcode)s" % vars()
    130             if cid not in certs.keys():
    131                 em = 'Certificate with ID %s %s not found\n' % (certcode, student.get('CourseMajor'))
    132                 logger.info(em)
    133                 no_import.write(em)
    134                 no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
    135                 continue
    136             certificate_doc = certs[cid].getContent()
    137             level = student.get('StudentLevel')
    138             try:
    139                 int(level)
    140             except:
    141                 em = 'Student with ID %(MatricNo)s StudentLevel is empty\n' % student
    142                 logger.info(em)
    143                 no_import.write(em)
    144                 no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
    145                 continue
    146             matric_no = student.get('MatricNo')
    147             if matric_no not in matrics:
    148                 matrics.append(matric_no)
    149                 sid = self.generateStudentId(student.get('Lastname')[0])
    150                 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
    151                 students_folder.invokeFactory('Student', sid)
    152                 logger.info('%(tr_count)s: Creating Student with ID %(sid)s Matric_no %(matric_no)s ' % vars())
    153                 student_obj = getattr(self,sid)
    154                 access_code = "%d" % random.randint(1000000000,9999999999)
    155                 student_obj.getContent().makeStudentMember(sid,access_code,)
    156                 pwl_dict = {'student_id': sid,'access_code':access_code}
    157                 student_obj.invokeFactory('StudentApplication','application')
    158                 application = student_obj.application
    159                 da = {'Title': 'Application Data'}
    160                 student_obj.invokeFactory('StudentPersonal','personal')
    161                 da['jamb_reg_no'] = student.get('EntryRegNo')
    162                 personal = student_obj.personal
    163                 dp = {'Title': 'Personal Data'}
    164                 student_obj.invokeFactory('StudentClearance','clearance')
    165                 clearance = student_obj.clearance
    166                 dc = {'Title': 'Clearance/Eligibility Record'}
    167                 dc['matric_no'] = matric_no
    168                 state = student.get('State')
    169                 lga = student.get('LGA')
    170                 if state and lga:
    171                     lga =  state + ' / ' + lga
    172                 else:
    173                     lga = "None"
    174                 dc['lga'] = lga
    175                 dc['nationality'] = student.get('Nationality')
    176                 dc['email'] = student.get('Emailaddress')
    177                 dp['firstname'] = student.get('FirstName')
    178                 dp['middlename'] = student.get('MiddleName')
    179                 dp['lastname'] = student.get('Lastname')
    180                 dp['former_surname'] = student.get('FormerSurname')
    181                 dp['sex'] = student.get('Sex') == 'F'
    182                 dp['perm_address'] = student.get('PermanentAddress')
    183                 dp['perm_city'] = student.get('PermanentAddressCity')
    184                 dp['campus_address'] = student.get('CampusAddress')
    185                 dp['phone'] = student.get('PhoneNumber')
    186                 application.getContent().edit(mapping=da)
    187                 personal.getContent().edit(mapping=dp)
    188                 clearance.getContent().edit(mapping=dc)
    189                 #
    190                 # Study Course
    191                 #
    192                 student_obj.invokeFactory('StudentStudyCourse','study_course')
    193                 studycourse = student_obj.study_course
    194                 dsc = {}
    195                 from_certificate = ['title',
    196                                    'max_elect',
    197                                    'max_pass',
    198                                    'n_core',
    199                                    'nr_years',
    200                                    'probation_credits',
    201                                    'promotion_credits',
    202                                    'start_level',
    203                                   ]
    204                 for f in from_certificate:
    205                     dsc[f] = getattr(certificate_doc,f)
    206                 dsc['faculty'] = fac_id
    207                 dsc['department'] = dep_id
    208                 dsc['study_course'] = certcode
    209                 css = student.get('CurrentSession') or '2004-2005'
    210                 cs = int(css.split('-')[0]) - 2000
    211                 cl = int(student.get('StudentLevel') or '100')/100
    212                 dsc['entry_session'] = "200%s" % (cs - cl)
    213                 dsc['clr_ac_pin'] = access_code
    214                 studycourse.getContent().edit(mapping=dsc)
    215                 #
    216                 # Level
    217                 #
    218 ##                l = getattr(studycourse,level,None)
    219 ##                if 0 and l is None:
    220 ##                    #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
    221 ##                    logger.info('Creating Level %(StudentLevel)s for %(fullname)s' % student)
    222 ##                    studycourse.invokeFactory('StudentStudyLevel', level)
    223 ##                    l = getattr(studycourse, level)
    224 ##                    certificate = certs[certcode]
    225 ##                    cert_level = getattr(certificate,level,None)
    226 ##                    if cert_level is None:
    227 ##                        logger.info('Level %(level)s not in %(certcode)s' % vars())
    228 ##                    l.getContent().edit(mapping={'Title': "Level %s" % level})
    229             else:
    230                 em = 'Student with ID %(MatricNo)s %(fullname)s already exists\n' % student
    231                 logger.info(em)
    232                 no_import.write(em)
    233                 no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
    234                 continue
    235             if tr_count > MAX_TRANS:
    236                 transaction.commit()
    237                 em = 'Transaction commited\n' % student
    238                 logger.info(em)
    239                 tr_count = 0
    240             tr_count += 1
    241             pwl_dict.update(dc)
    242             pwl_dict.update(da)
    243             pwl_dict.update(dp)
    244             wftool = self.portal_workflow
    245             pwlist.append(pwl_template.substitute(pwl_dict))
    246             wftool.doActionFor(student_obj,'clear_and_validate')
    247             student_obj.manage_setLocalRoles(sid, ['Owner',])
    248             wftool.doActionFor(application,'close')
    249             application.manage_setLocalRoles(sid, ['Owner',])
    250             wftool.doActionFor(clearance,'close')
    251             clearance.manage_setLocalRoles(sid, ['Owner',])
    252             wftool.doActionFor(personal,'close')
    253             personal.manage_setLocalRoles(sid, ['Owner',])
    254             wftool.doActionFor(studycourse,'close_for_edit')
    255             studycourse.manage_setLocalRoles(sid, ['Owner',])
    256         open("%s/import/pwlist-%s.csv" % (i_home,name),"w+").write('\n'.join(pwlist))
    257         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    258     ###)
    259 
    260     security.declareProtected(ModifyPortalContent,"loadPumeResultsFromCSV")###(
    261     def loadPumeResultsFromCSV(self):
    262         """load Fulltime Studentdata from CSV values into pumeresults catalog"""
    263         import transaction
    264         import random
    265 ##        csv_d = {'jamb_reg_no': "RegNumber", ###(
    266 ##                 'status': "Admission Status",
    267 ##                 'name': "Name",
    268 ##                 'score': "Score",
    269 ##                 'sex': "Sex",
    270 ##                 'faculty': "Faculty",
    271 ##                 'department': "Dept",
    272 ##                 'course': "Course",
    273 ##                 'course_code_org': "Course Code",
    274 ##                 }
    275 ###)
    276         csv_d = {'jamb_reg_no': "JAMBRegno",
    277                  'name': "Name",
    278                  'score': "Score",
    279                  'sex': "Sex",
    280                  'course': "Course",
    281                  'faculty': "Faculty",
    282                  'department': "Dept",
    283                  'course_code_org': "Course Code",
    284                  'status': "Admission Status",
    285                  'result_type': None,
    286                  }
    287         csv_fields = [f[1] for f in csv_d.items() if f[1]]
    288         tr_count = 0
    289         total = 0
    290         #name = 'pup_new'
    291         name = 'pup_update'
    292         update = name.endswith('update')
    293         no_import = []
    294         ok_import = []
    295         ok_import.append('%s' % ','.join(['"%s"' % fn for fn in csv_d.keys()]))
    296         no_import.append('%s' % ','.join(['"%s"' % fn for fn in csv_fields]))
    297         current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
    298         ok_import_name = "%s/import/%s_imported_%s.csv" % (i_home,name,current)
    299         #open(ok_import_name,"w").write('\n'.join(no_import))
    300         no_import_name = "%s/import/%s_not_imported_%s.csv" % (i_home,name,current)
    301         #open(no_import_name,"w").write('\n'.join(no_import))
    302         logger = logging.getLogger('Import.%s' % name)
    303         starttime = DateTime.now()
    304         logger.info('Start loading from %s.csv' % name)
    305         try:
    306             result = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
    307         except:
    308             logger.error('Error reading %s.csv' % name)
    309             return
    310         pume = self.portal_pumeresults
    311         format = ','.join(['"%%(%s)s"' % fn for fn in csv_fields])
    312         import_format = ','.join(['"%%(%s)s"' % fn for fn in csv_d.keys()])
    313         eduplicate = '%s,"duplicate"' % format
    314         einvalidjamb = '%s,"invalid JambRegNo"' % format
    315         added = 'added ,%s' % format
    316         #from pdb import set_trace;set_trace()
    317         for jamb in result:
    318             dict = {}
    319             for f,fn in csv_d.items():
    320                 dict[f] = jamb.get(csv_d[f])
    321             dict['result_type'] = 'DE'
    322             jnr = jamb.get(csv_d['jamb_reg_no'])
    323             if not checkJambNo(jnr):
    324                 logger.info(einvalidjamb % jamb)
    325                 dd = {}
    326                 for f,fn in csv_d.items():
    327                     dd[fn] = getattr(data,f)
    328                     no_import.append(eduplicate % dd)
    329                     no_import.append(eduplicate % jamb)
    330                 continue
    331             res = pume(jamb_reg_no=jnr)
    332             if len(res) > 0:
    333                 if update:
    334                     try:
    335                         pume.modifyRecord(**dict)
    336                     except ValueError:
    337                         logger.info(eduplicate % jamb)
    338                         continue
    339                     except KeyError:
    340                         pume.addRecord(**dict)
    341                         logger.info(added % jamb)
    342                         continue
    343                 else:
    344                     data = res[0]
    345                     if data.name != jamb.get(csv_d['name']):
    346                         #set_trace()
    347                         logger.info(eduplicate % jamb)
    348                         #em = 'Student with REG-NO %(jamb_reg_no)s already exists\n' % dict
    349                         #logger.info(em)
    350                         dd = {}
    351                         for f,fn in csv_d.items():
    352                             dd[fn] = getattr(data,f)
    353                         no_import.append(eduplicate % dd)
    354                         no_import.append(eduplicate % jamb)
    355                     continue
    356             try:
    357                 pume.addRecord(**dict)
    358                 ok_import.append(import_format % dict)
    359             except ValueError:
    360                 logger.info(eduplicate % jamb)
    361                 #em = 'Student with REG-NO %(jamb_reg_no)s already exists\n' % dict
    362                 #logger.info(em)
    363                 no_import.append(eduplicate % jamb)
    364         logger.info('End loading from %s.csv' % name)
    365         if len(no_import) > 1:
    366             open(no_import_name,"w+").write('\n'.join(no_import))
    367         open(ok_import_name,"w+").write('\n'.join(ok_import))
    368         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    369     ###)
     84
    37085
    37186    security.declareProtected(ModifyPortalContent,"createDEStudents")###(
     
    405120        no_certificate = "no certificate %s" % format
    406121        open("%s/import/%s_not_imported.csv" % (i_home,name),"w").write('\n'.join(no_import))
    407         logger = logging.getLogger('Import.%s' % name)
    408         logger.info('start loading from %s.csv' % name)
     122        logger = logging.getLogger('Students.StudentsFolder.createDEStudents')
     123        logger.info('Start loading from %s.csv' % name)
    409124        l = self.portal_catalog({'meta_type': "Certificate"})
    410125        certs = {}
     
    418133            return
    419134        for jamb in result:
    420             jamb['Error'] = "Processing "
     135            jamb['Error'] = "Processing"
    421136            logger.info(format % jamb)
    422137            jamb_reg_no = jamb.get(csv_d['jamb_reg_no'])
     
    624339        no_certificate = "no certificate %s" % format
    625340        open("%s/import/%s_not_imported.csv" % (i_home,name),"w").write('\n'.join(no_import))
    626         logger = logging.getLogger('Import.%s' % name)
    627         logger.info('start loading from %s.csv' % name)
     341        logger = logging.getLogger('Students.StudentsFolder.createNewStudents')
     342        logger.info('Start loading from %s.csv' % name)
    628343        l = self.portal_catalog({'meta_type': "Certificate"})
    629344        certs = {}
     
    829544        no_import = []
    830545        imported = []
    831         logger = logging.getLogger('Import.%s' % name)
     546        logger = logging.getLogger('Students.StudentsFolder.importReturningStudents')
    832547        try:
    833548            returning = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    849564            if start:
    850565                start = False
    851                 logger.info('start loading from %s.csv' % name)
     566                logger.info('Start loading from %s.csv' % name)
    852567                s = ','.join(['"%s"' % fn for fn in student.keys()])
    853568                imported.append(s)
     
    922637        for k,v in verdicts_voc.items():
    923638            rverdicts[v.upper()] = k
    924         logger = logging.getLogger('fixVerdicts')
     639        rverdicts['STUDENT ON PROBATION'] = 'C'
     640        logger = logging.getLogger('Students.StudentsFolder.fixVerdicts')
    925641        try:
    926642            verdicts = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    933649            if start:
    934650                start = False
    935                 logger.info('start loading from %s.csv' % name)
     651                logger.info('Start loading from %s.csv' % name)
    936652                s = ','.join(['"%s"' % fn for fn in verdict.keys()])
    937653                no_import.append('%s,"Error"' % s)
     
    957673                        no_import.append( format_error % verdict)
    958674                        continue
    959                 try:
    960                     st_cat.modifyRecord(id = student_id,
     675                st_cat.modifyRecord(id = student_id,
    961676                                    verdict=verdict_code)
    962                 except KeyError:
    963                     student['Error'] = "Not found in students_catalog"
    964                     no_import.append( format_error % student)
    965                     continue
     677
    966678                dsc = {}
    967679                dsc['current_verdict'] = verdict_code
    968680                study_course.getContent().edit(mapping=dsc)
     681            else:
     682                student['Error'] = "Not found in students_catalog"
     683                no_import.append( format_error % student)
     684                continue
    969685            tr_count += 1
    970686            if tr_count > 1000:
     
    1017733        st_cat = self.students_catalog
    1018734        no_import = []
    1019         logger = logging.getLogger('getEntryMode.%s' % name)
     735        logger = logging.getLogger('Students.StudentsFolder.fixEntryModeForReturning')
    1020736        try:
    1021737            returning = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    1027743            if start:
    1028744                start = False
    1029                 logger.info('start loading from %s.csv' % name)
     745                logger.info('Start loading from %s.csv' % name)
    1030746                s = ','.join(['"%s"' % fn for fn in student.keys()])
    1031747                no_import.append('%s,"Error"' % s)
     
    1120836        no_import = []
    1121837        imported = []
    1122         logger = logging.getLogger('Import.%s' % name)
     838        logger = logging.getLogger('Students.StudentsFolder.updateReturningStudents')
    1123839        try:
    1124840            returning = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    1139855            if start:
    1140856                start = False
    1141                 logger.info('start loading from %s.csv' % name)
     857                logger.info('Start loading from %s.csv' % name)
    1142858                s = ','.join(['"%s"' % fn for fn in student.keys()])
    1143859                imported.append(s)
     
    1214930        no_import = []
    1215931        imported = []
    1216         logger = logging.getLogger('Import.%s' % name)
     932        logger = logging.getLogger('Students.StudentsFolder.importResults')
    1217933        try:
    1218934            results = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    1233949            if start:
    1234950                start = False
    1235                 logger.info('start loading from %s.csv' % name)
     951                logger.info('Start loading from %s.csv' % name)
    1236952                s = ','.join(['"%s"' % fn for fn in result.keys()])
    1237953                imported.append(s)
     
    13391055        open("%s/import/%s_not_imported.csv" % (i_home,name),"w").write(
    13401056                    '\n'.join(no_import))
    1341         logger = logging.getLogger('Import.%s' % name)
     1057        logger = logging.getLogger('Students.StudentsFolder.updateStudyCourse')
    13421058        logger.info('Start loading from %s.csv' % name)
    13431059        l = self.portal_catalog({'meta_type': "Certificate"})
     
    13541070                                     'SearchableText': jamb_reg_no })
    13551071            if not res:
    1356                 em = 'Student with RegNo %s does not exists\n' % jamb_reg_no
     1072                em = 'Student with jamb_reg_no %s does not exists\n' % jamb_reg_no
    13571073                logger.info(em)
    1358                 jamb['Error'] = "Student not exists"
     1074                jamb['Error'] = "Student does not exist"
    13591075                no_import.append(format % jamb)
    13601076                continue
     
    13981114    ###)
    13991115
    1400     security.declareProtected(ModifyPortalContent,"OLDloadPumeResultsFromCSV")###(
    1401     def OLDloadPumeResultsFromCSV(self):
    1402         """load Fulltime Studentdata from CSV values"""
    1403         import transaction
    1404         import random
    1405         wftool = self.portal_workflow
    1406         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
    1407         csv_d = {'jamb_reg_no': "JAMBRegno",
    1408                  'jamb_lastname': "Name",
    1409                  'pume_options': "Options",
    1410                  'session': "Session",
    1411                  'days': "Days",
    1412                  'response': "Responce",
    1413                  'wrong': "Wrong",
    1414                  'pume_eng_score': "EngScore",
    1415                  'pume_gen_score': "GenScore",
    1416                  'pume_tot_score': "Score",
    1417                  'batch': "Batch",
    1418                  'serial': "SerialNo",
    1419                  'jamb_score': "JambScore",
    1420                  'omitted':"Omitted",
    1421                  'search_key': "SearchKey",
    1422                  'jamb_sex': "Sex",
    1423                  'fac1': "Fac1",
    1424                  'fac2': "Fac2",
    1425                  'jamb_first_cos': "CourseofStudy",
    1426                  'stud_status':"StudStatus",
    1427                  'registered': "Registered",
    1428                  'jamb_state': "State",
    1429                  'eng_fail': "EngFail",
    1430                  'gen_fail': "GenFail",
    1431                  'un_ans_eng': "UnAnsEng",
    1432                  'un_ans_eng': "UnAnsGen",
    1433                  'total_ans': "TotalUnAns",
    1434                  'dept': "Dept",
    1435                  'jamb_second_cos': "Course2",
    1436                  'jamb_third_cos': "course3",
    1437                  }
    1438         csv_fields = [f[1] for f in csv_d.items()]
    1439         tr_count = 0
    1440         name = 'pume_results'
    1441         no_import = []
    1442         s = ','.join(['"%s"' % fn for fn in csv_fields])
    1443         no_import.append('%s\n' % s)
    1444         logger = logging.getLogger('Import.%s' % name)
    1445         logger.info('Start loading from %s.csv' % name)
    1446         try:
    1447             result = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
    1448         except:
    1449             logger.error('Error reading %s.csv' % name)
    1450             return
    1451         for jamb in result:
    1452             format = ','.join(['"%%(%s)s"' % fn for fn in csv_fields])
    1453             processing = "processing %s" % format
    1454             logger.info(processing % jamb)
    1455             jamb_reg_no = jamb.get(csv_d['jamb_reg_no'])
    1456             #import pdb;pdb.set_trace()
    1457             res = self.portal_catalog({'portal_type': "StudentApplication",
    1458                                      'jamb_reg_no': jamb_reg_no })
    1459             if res:
    1460                 em = 'Student with REG-NO %s already exists\n' % jamb_reg_no
    1461                 logger.info(em)
    1462                 no_import.append(em)
    1463                 no_import.append(format % jamb)
    1464                 continue
    1465             cert_id = jamb.get(csv_d['jamb_first_cos']).upper()
    1466             res = self.portal_catalog({'portal_type': "Certificate",
    1467                                      'id': cert_id })
    1468             if len(res) < 1:
    1469                 em = 'No Certificate with ID %s \n' % cert_id
    1470                 logger.info(em)
    1471                 no_import.append(em)
    1472                 no_import.append(format % jamb)
    1473                 continue
    1474             cert = res[0].getObject()
    1475             cert_path = res[0].getPath()
    1476             cert_doc = cert.getContent()
    1477             jamb_name = jamb.get(csv_d['jamb_lastname'])
    1478             jamb_name.replace('>','')
    1479             names = jamb_name.split()
    1480             letter = names[-1][0].upper()
    1481             sid = self.generateStudentId(letter)
    1482             not_created = True
    1483             while not_created:
    1484                 try:
    1485                     students_folder.invokeFactory('Student', sid)
    1486                     not_created = False
    1487                 except BadRequest:
    1488                     sid = self.generateStudentId(letter)
    1489             logger.info('%(tr_count)s: Creating Student with ID %(sid)s REG-NO %(jamb_reg_no)s ' % vars())
    1490             student = getattr(self,sid)
    1491             student.manage_setLocalRoles(sid, ['Owner',])
    1492             student.invokeFactory('StudentClearance','clearance')
    1493             #wftool.doActionFor(student.clearance,'open')
    1494             dp = {'Title': 'Clearance/Eligibility Record'}
    1495             student.clearance.manage_setLocalRoles(sid, ['Owner',])
    1496             student.invokeFactory('StudentPume','pume')
    1497             dp = {'Title': 'Pume Data'}
    1498             student.invokeFactory('StudentApplication','application')
    1499             da = {'Title': 'Application Data'}
    1500             da["jamb_lastname"] = jamb_name
    1501             da_fields = ('jamb_reg_no',
    1502                          'jamb_sex',
    1503                          'jamb_state',
    1504                          'jamb_score',
    1505                          'jamb_first_cos',
    1506                          'jamb_sex',
    1507                          'jamb_state',
    1508                          'jamb_first_cos',
    1509                          'jamb_second_cos',
    1510                          )
    1511             for f in da_fields:
    1512                 da[f] = jamb.get(csv_d[f])
    1513             app = student.application
    1514             app.getContent().edit(mapping=da)
    1515             app.manage_setLocalRoles(sid, ['Owner',])
    1516             #wftool.doActionFor(app,'close')
    1517             dp_fields = (
    1518                          'pume_eng_score',
    1519                          'pume_gen_score',
    1520                          'pume_tot_score',
    1521                          )
    1522             for f in dp_fields:
    1523                 dp[f] = float(jamb.get(csv_d[f]))
    1524             pume = student.pume
    1525             pume.getContent().edit(mapping=dp)
    1526             #wftool.doActionFor(pume,'close')
    1527             pume.manage_setLocalRoles(sid, ['Owner',])
    1528             #
    1529             # Study Course
    1530             #
    1531             student.invokeFactory('StudentStudyCourse','study_course')
    1532             study_course = student.study_course
    1533             dsc = {}
    1534             from_certificate = ['title',
    1535                                'max_elect',
    1536                                'max_pass',
    1537                                'n_core',
    1538                                'nr_years',
    1539                                'probation_credits',
    1540                                'promotion_credits',
    1541                                'start_level',
    1542                               ]
    1543             for f in from_certificate:
    1544                 dsc[f] = getattr(cert_doc,f)
    1545             cpl = cert_path.split('/')
    1546             dsc['faculty'] = cpl[-4]
    1547             dsc['department'] = cpl[-3]
    1548             dsc['study_course'] = cert_id
    1549             dsc['entry_session'] = jamb.get(csv_d['session'])
    1550             study_course.getContent().edit(mapping=dsc)
    1551             student.getContent().createSubObjects()
    1552             if dp['pume_tot_score']>49:
    1553                 wftool.doActionFor(student,'pume_pass')
    1554                 wftool.doActionFor(student,'admit')
    1555             else:
    1556                 wftool.doActionFor(student,'pume_fail')
    1557                 wftool.doActionFor(student,'reject_admission')
    1558             if len(no_import) > 1:
    1559                 open("%s/import/%s_not_imported.csv" % (i_home,name),"w").write(
    1560                      '\n'.join(no_import))
    1561         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    1562     ###)
    1563 
    1564     security.declareProtected(ModifyPortalContent,"loadFullTimeStudentsResultsFromCSV") ###(
    1565     def loadFullTimeStudentsResultsFromCSV(self):
    1566         """load Fulltime Studentdata from CSV values"""
    1567         #return
    1568         level_wf_actions = {}
    1569         level_wf_actions["SUCCESSFUL STUDENT"] = "pass_A"
    1570         level_wf_actions["STUDENT WITH CARRYOVER COURSES"] = "pass_B"
    1571         level_wf_actions["STUDENT FOR PROBATION"] = "probate_C"
    1572         level_wf_actions["STUDENT ON PROBATION/TRANSFER"] = "reject_D"
    1573         import transaction
    1574         wftool = self.portal_workflow
    1575         tr_count = 0
    1576         name = 'short_full_time_results_2004_2005'
    1577         no_import = False
    1578         if not no_import:
    1579             no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
    1580             no_import.write('"Matnumber","CosCode","Ansbook","CosStuatus","Session","Mat_Cos","Score","CarryLevel","Grade","Weight","Semster","Verdict","Level","id","GPA"\n')
    1581         logger = logging.getLogger('import.%s' % name)
    1582         logger.info('Start loading from %s.csv' % name)
    1583         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
    1584         try:
    1585             results = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
    1586         except:
    1587             logger.error('Error reading %s.csv' % name)
    1588             return
    1589         l = self.portal_catalog({'meta_type': "Course"})
    1590         courses = {}
    1591         for c in l:
    1592             courses[c.id] = c.getObject()
    1593         level_changed = False
    1594         student_changed = False
    1595         sid = ''
    1596         #import pdb;pdb.set_trace()
    1597         for result in results:
    1598             temp_sid = result.get('Matnumber')
    1599             if temp_sid != sid:
    1600                 student_changed = True
    1601                 res = self.portal_catalog({'meta_type': "StudentClearance",
    1602                                          'SearchableText': temp_sid })
    1603                 if not res:
    1604                     em = 'Student with ID %(Matnumber)s not found\n' % result
    1605                     logger.info(em)
    1606                     no_import.write(em)
    1607                     no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
    1608                     continue
    1609                 elif len(res) > 1:
    1610                     em = 'More than one Student with ID %(Matnumber)s found\n' % result
    1611                     logger.info(em)
    1612                     no_import.write(em)
    1613                     no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
    1614                     continue
    1615                 sid = temp_sid
    1616                 sf = res[0].getObject().aq_parent
    1617                 sc = getattr(sf,'study_course')
    1618                 level = ''
    1619             else:
    1620                 student_changed = False
    1621             course = result.get('CosCode')
    1622             if course not in courses.keys():
    1623                 em = 'Course with ID %(CosCode)s not found\n' % result
    1624                 logger.info(em)
    1625                 no_import.write(em)
    1626                 no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
    1627                 continue
    1628             course_doc = courses[course].getContent()
    1629             temp_level = result.get('Level')
    1630             student_id = sf.getId()
    1631             result['StudentId'] = student_id
    1632             if temp_level != level:
    1633                 try:
    1634                     int(temp_level)
    1635                 except:
    1636                     em = 'Result with ID %(Matnumber)s Course %(CosCode)s Level is empty\n' % result
    1637                     logger.info(em)
    1638                     no_import.write(em)
    1639                     no_import.write('"%(Matnumber)s","%(CosCode)s","%(Ansbook)s","%(CosStuatus)s","%(Session)s","%(Mat_Cos)s","%(Score)s","%(CarryLevel)s","%(Grade)s","%(Weight)s","%(Semster)s","%(Verdict)s","%(Level)s","%(id)s","%(GPA)s"\n' % result)
    1640                     continue
    1641                 level_changed = True
    1642                 if 'dlev' in vars().keys():
    1643                     wftool.doActionFor(l,level_wf_actions[dlev['verdict']])
    1644                 level = temp_level
    1645                 l = getattr(sc,level,None)
    1646                 if l is None:
    1647                     logger.info('Creating Level %(Level)s for %(StudentId)s %(Matnumber)s' % result)
    1648                     sc.invokeFactory('StudentStudyLevel', level)
    1649                     l = getattr(sc, level)
    1650                     l.manage_setLocalRoles(student_id, ['Owner',])
    1651             else:
    1652                 level_changed = False
    1653             cr = getattr(l,course,None)
    1654             if cr is None:
    1655                 logger.info('Creating Course %(CosCode)s for %(StudentId)s %(Matnumber)s in Level %(Level)s' % result)
    1656                 l.invokeFactory('StudentCourseResult',course)
    1657             cr = getattr(l,course)
    1658             dcr = {}
    1659             from_course = ['title',
    1660                            'credits',
    1661                            'passmark',
    1662                            ]
    1663             for f in from_course:
    1664                 dcr[f] = getattr(course_doc,f)
    1665             dlev = {}
    1666             dcr['ansbook'] = result.get('Ansbook')
    1667             dcr['semester'] = getInt(result.get('Semster'))
    1668             dcr['status'] = result.get('CosStuatus')
    1669             dcr['score'] = getInt(result.get('Score'))
    1670             dlev['session'] = result.get('Session')
    1671             dcr['carry_level'] = result.get('CarryLevel')
    1672             dcr['grade'] = result.get('Grade')
    1673             dcr['weight'] = result.get('Weight')
    1674             dlev['verdict'] = result.get('Verdict')
    1675             dcr['import_id'] = result.get('id')
    1676             gpa = result.get('GPA').replace(',','.')
    1677             dlev['imported_gpa'] = getFloat(gpa)
    1678             cr.getContent().edit(mapping = dcr)
    1679             cr.manage_setLocalRoles(student_id, ['Owner',])
    1680             l.getContent().edit(mapping = dlev)
    1681             if tr_count > MAX_TRANS:
    1682                 transaction.commit()
    1683                 tr_count = 0
    1684             tr_count += 1
    1685             wftool.doActionFor(cr,'close')
    1686         wftool.doActionFor(l,level_wf_actions[dlev['verdict']])
    1687         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    1688 
    1689 ###)
    1690 
    1691     security.declareProtected(ModifyPortalContent,"loadJAMBFromCSV")###(
    1692     def loadJAMBFromCSV(self):
    1693         """load JAMB data from CSV values"""
    1694         #return
    1695         students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject()
    1696         import transaction
    1697         tr_count = 0
    1698         name = 'SampleJAMBDataII'
    1699         wftool = self.portal_workflow
    1700         no_import = False
    1701         if not no_import:
    1702             no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
    1703             no_import.write('REG-NO,NAME,SEX,STATE,LGA,ENG-SCORE,SUBJ1,SUBJ1-SCORE,SUBJ2,SUBJ2-SCORE,SUBJ3,SUBJ3-SCORE,AGGREGATE,UNIV1,FACULTY1,COURSE1,UNIV2,FACULTY2,COURSE2')
    1704         logger = logging.getLogger('Import.%s' % name)
    1705         logger.info('Start loading from %s.csv' % name)
    1706         try:
    1707             result = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
    1708         except:
    1709             logger.error('Error reading %s.csv' % name)
    1710             return
    1711         for jamb in result:
    1712             logger.info('processing %(REG-NO)s,%(NAME)s,%(SEX)s,%(STATE)s,%(LGA)s,%(ENG-SCORE)s,%(SUBJ1)s,%(SUBJ1-SCORE)s,%(SUBJ2)s,%(SUBJ2-SCORE)s,%(SUBJ3)s,%(SUBJ3-SCORE)s,%(AGGREGATE)s,%(UNIV1)s,%(FACULTY1)s,%(COURSE1)s,%(UNIV2)s,%(FACULTY2)s,%(COURSE2)s\n' % jamb)
    1713             jamb_reg_no = jamb.get('REG-NO')
    1714             res = self.portal_catalog({'meta_type': "StudentApplication",
    1715                                      'jamb_reg_no': jamb_reg_no })
    1716             if res:
    1717                 em = 'Student with REG-NO %(REG-NO)s already exists\n' % jamb
    1718                 logger.info(em)
    1719                 no_import.write(em)
    1720                 no_import.write('%(REG-NO)s,%(NAME)s,%(SEX)s,%(STATE)s,%(LGA)s,%(ENG-SCORE)s,%(SUBJ1)s,%(SUBJ1-SCORE)s,%(SUBJ2)s,%(SUBJ2-SCORE)s,%(SUBJ3)s,%(SUBJ3-SCORE)s,%(AGGREGATE)s,%(UNIV1)s,%(FACULTY1)s,%(COURSE1)s,%(UNIV2)s,%(FACULTY2)s,%(COURSE2)s\n' % jamb)
    1721                 continue
    1722             jamb_name = jamb.get("NAME")
    1723             jamb_name.replace('>','')
    1724             names = jamb_name.split()
    1725             letter = names[-1][0].upper()
    1726             sid = self.generateStudentId(letter)
    1727             not_created = True
    1728             while not_created:
    1729                 try:
    1730                     students_folder.invokeFactory('Student', sid)
    1731                     not_created = False
    1732                 except BadRequest:
    1733                     sid = self.generateStudentId(letter)
    1734             logger.info('%(tr_count)s: Creating Student with ID %(sid)s REG-NO %(jamb_reg_no)s ' % vars())
    1735             student = getattr(self,sid)
    1736             student.manage_setLocalRoles(sid, ['Owner',])
    1737             student.invokeFactory('StudentApplication','application')
    1738             da = {'Title': 'Application Data'}
    1739             da["jamb_reg_no"] = jamb.get("REG-NO")
    1740             da["jamb_lastname"] = jamb_name
    1741             da["jamb_sex"] = jamb.get("SEX")
    1742             da["jamb_state"] = jamb.get("STATE")
    1743             da["jamb_lga"] = jamb.get("LGA")
    1744             da["jamb_score"] = jamb.get("AGGREGATE")
    1745             da["jamb_first_cos"] = jamb.get("COURSE1")
    1746             da["jamb_second_cos"] = jamb.get("COURSE2")
    1747             da["jamb_first_uni"] = jamb.get("UNIV1")
    1748             da["jamb_second_uni"] = jamb.get("UNIV2")
    1749             app = student.application
    1750             app_doc = app.getContent()
    1751             app_doc.edit(mapping=da)
    1752             #wftool.doActionFor(app,'open',dest_container=app)
    1753             app.manage_setLocalRoles(sid, ['Owner',])
    1754             student.getContent().createSubObjects()
    1755         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
    1756     ###)
    1757 
    1758  
     1116
     1117
    17591118    security.declareProtected(View,"fixOwnership")
    17601119    def fixOwnership(self):
  • WAeUP_SRP/trunk/WAeUPTables.py

    r1306 r1571  
    142142        rec = records[0]
    143143        self.modifyRecord(bed=rec.bed,student=student_id)
    144         s_logger = logging.getLogger('Accommodation.SearchAndReserveBed')
    145         s_logger.info("%s reserved bed %s" % (student_id,rec.bed))
     144        s_logger = logging.getLogger('WAeUPTables.AccommodationTable.searchAndReserveBed')
     145        s_logger.info('%s reserved bed %s' % (student_id,rec.bed))
    146146        return 1,rec.bed
    147147
  • WAeUP_SRP/trunk/WAeUPTool.py

    r1467 r1571  
    109109        student_entry = getattr(self.portal_directories.students,student_id,None)
    110110        if student_entry is None:
    111             return 
     111            return
    112112        setattr(student_entry,'password',password)
    113113    ###)
     
    288288        "create Datastructure for a returning Student"
    289289        #import pdb;pdb.set_trace()
    290         logger = logging.getLogger('Student.CreateData')
     290        logger = logging.getLogger('WAeUPTool.makeStudentData')
    291291        students_folder = self.portal_url.getPortalObject().campus.students
    292292        res = self.students_catalog(id=student_id)
     
    296296        if res:
    297297            student = res[0]
    298         logger.info('"%s", "creating Datastructure"' % student_id)
     298        logger.info('%s creating Datastructure' % student_id)
    299299        s_results = self.results_import(matric_no = st.matric_no)
    300300        lnr = self.getLevelFromResultsCosCode(s_results)
     
    404404        "create the StudyLevel for a returning Student"
    405405        #import pdb;pdb.set_trace()
    406         logger = logging.getLogger('Student.CreateLevel')
     406        logger = logging.getLogger('WAeUPTool.makeStudentLevel')
    407407        students_folder = self.portal_url.getPortalObject().campus.students
    408408        res = self.students_catalog(id=student_id)
     
    415415        if res:
    416416            results = res
    417         logger.info('"%s", "creating Level", "%s"' % (student_id,level))
     417        logger.info('%s creating Level %s' % (student_id,level))
    418418        #
    419419        # Level
  • WAeUP_SRP/trunk/Widgets.py

    r1557 r1571  
    343343    def validate(self, datastructure, **kw):
    344344        """Validate datastructure and update datamodel."""
    345         logger = logging.getLogger('Secret.Validate')
     345        logger = logging.getLogger('Widgets.SecretWidget.validate')
    346346        valid = CPSStringWidget.validate(self, datastructure, **kw)
    347347        #import pdb;pdb.set_trace()
     
    370370            name = " ".join(cvs)
    371371            if not found:
    372                 logger.info('"%(matric_no)s","mismatch", "%(value)s", "not in","%(name)s"' % vars())
     372                logger.info('%(matric_no)s mismatch %(value)s not in %(name)s' % vars())
    373373                err = 'No Name does match.'
    374374            else:
    375                 logger.info('"%(matric_no)s","found", "%(value)s", "in","%(name)s"' % vars())
     375                logger.info('%(matric_no)s found %(value)s in %(name)s' % vars())
    376376        if err:
    377377            datastructure.setError(widget_id, err)
     
    392392        """Validate datastructure and update datamodel."""
    393393        valid = CPSStringWidget.validate(self, datastructure, **kw)
    394         logger = logging.getLogger('MatricNo.Validate')
     394        logger = logging.getLogger('Widgets.MatricNoWidget.validate')
    395395        #import pdb;pdb.set_trace()
    396396        returning = self.returning_import
     
    400400        value = datastructure[widget_id]
    401401        if not valid or not value:
    402             err = 'Invalid MatricNo String %s.' % value
    403             logger.info('"%s","invalid MatricNo String"' % value)
     402            err = 'Invalid matric_no string %s.' % value
     403            logger.info('%s invalid matric_no string' % value)
    404404        else:
    405405            value = value.upper()
     
    408408                res = returning(matric_no = value)
    409409                if len(res) < 1:
    410                     logger.info('"%s","MatricNo not found."' % value)
    411                     err = 'No Student with MatricNo %s.' % (value)
     410                    logger.info('%s matric_no not found' % value)
     411                    err = 'No Student with matric_no %s.' % (value)
    412412                    continue
    413413                datastructure['student'] = res[0]
    414414                res = results(matric_no = value)
    415415                if len(res) < 1:
    416                     err = 'No Results with MatricNo %s.' % (value)
     416                    err = 'No Results with matric_no %s.' % (value)
    417417                    continue
    418418                datastructure['results'] = res
     
    436436        """Validate datastructure and update datamodel."""
    437437        valid = CPSStringWidget.validate(self, datastructure, **kw)
    438         logger = logging.getLogger('StudentId.Validate')
     438        logger = logging.getLogger('Widgets.StudentIdWidget.validate')
    439439        #import pdb;pdb.set_trace()
    440440        s_cat = self.students_catalog
     
    443443        value = datastructure[widget_id]
    444444        if not valid or not value:
    445             err = 'Invalid StudentId String %s.' % value
    446             logger.info('"%s","invalid StudentId String"' % value)
     445            err = 'Invalid id string %s.' % value
     446            logger.info('%s invalid id string' % value)
    447447            datastructure['student'] = None
    448448        else:
     
    450450            res = s_cat(id = value)
    451451            if not res:
    452                 logger.info('"%s","StudentId not found."' % value)
     452                logger.info('%s id not found' % value)
    453453                err = 'No Student with StudentId %s.' % (value)
    454454                datastructure['student'] = None
     
    699699    def validate(self, datastructure, **kw): ###(
    700700        """Validate datastructure and update datamodel."""
    701         s_logger = logging.getLogger('Pin.Validate')
     701        s_logger = logging.getLogger('Widgets.ScratchcardPinWidget.validate')
    702702        widget_id = self.getWidgetId()
    703703        v = datastructure[widget_id]
     
    718718            do = 0
    719719            err ='You are not a Student. PIN neither checked nor used.'
    720             s_logger.info('"%s","tried to use Scratchcard", "%s"' % (s_id,pin_str))
     720            s_logger.info('%s tried to use scratch card %s' % (s_id,pin_str))
    721721        elif len(b) > 1 and b.find('-') > -1:
    722722            do = 0
     
    729729        elif len(n) != 10:
    730730            do = 0
    731             err = 'Invalid PIN-Number length %d' % len(n)
    732             s_logger.info('"%s","Invalid PIN-Number length", "%d"' % (s_id,len(n)))
     731            err = 'invalid PIN length %d' % len(n)
     732            s_logger.info('%s invalid PIN length %d' % (s_id,len(n)))
    733733        elif self.reference == "":
    734734            ref = s_id
     
    737737            if datastructure.errors:
    738738                do = 0
    739                 datastructure.setError(widget_id, 'Errors in other data, PIN neither checked nor used.')
    740                 s_logger.info('"%s", "%s","entered wrong data together with pin", "%s"' % (s_id,ref,pin_str))
     739                datastructure.setError(widget_id, 'errors in other data, PIN neither checked nor used')
     740                s_logger.info('%s/%s entered wrong data together with PIN %s' % (s_id,ref,pin_str))
    741741        while do:
    742742            ok = pins.searchAndSetRecord(pin,ref,prefix)
    743743            if ok < -2 or ok > 2:
    744744                err = 'Unknown error, please report!'
    745                 s_logger.info('"%s","%s", "caused unknown error with pin", "%s"' % (s_id,ref,pin_str))
     745                s_logger.info('%s/%s caused unknown error with PIN %s' % (s_id,ref,pin_str))
    746746                break
    747747            elif ok == -2:
    748748                err = 'Service already activated but with a different PIN.'
    749                 s_logger.info('"%s","%s", "repeatedly activated service but with different pin", "%s"' % (s_id,ref,pin_str))
     749                s_logger.info('%s/%s repeatedly activated service but with different PIN %s' % (s_id,ref,pin_str))
    750750                break
    751751            elif ok == -1:
    752752                err = 'Invalid PIN'
    753                 s_logger.info('"%s","%s", "entered invalid pin", "%s"' % (s_id,ref,pin_str))
     753                s_logger.info('%s/%s entered invalid PIN %s' % (s_id,ref,pin_str))
    754754                break
    755755            if ok == 0:
    756                 err = 'PIN already used.'
    757                 s_logger.info('"%s","%s", "entered used pin", "%s"' % (s_id,ref,pin_str))
     756                err = 'PIN already used'
     757                s_logger.info('%s/%s entered used PIN %s' % (s_id,ref,pin_str))
    758758                break
    759759            if ok >= 1:
     
    762762                    if self.reference == "jamb_reg_no":
    763763                        err = "You are already logged in."
    764                         s_logger.info('"%s","%s", "checked admission though logged in", "%s"' % (s_id,ref,pin_str))
     764                        s_logger.info('%s/%s checked admission though logged in %s' % (s_id,ref,pin_str))
    765765                        break
    766766                    if ok == 1:
    767                         s_logger.info('"%s","%s", "successfully used pin", "%s"' % (s_id,ref,pin_str))
     767                        s_logger.info('%s/%s successfully used PIN %s' % (s_id,ref,pin_str))
    768768                    else:
    769                         s_logger.info('"%s","%s", "repeatedly used pin", "%s"' % (s_id,ref,pin_str))
     769                        s_logger.info('%s/%s repeatedly used PIN %s' % (s_id,ref,pin_str))
    770770                    break
    771771                else:
    772772                    student = getStudentByRegNo(self,ref)
    773                     s_logger.info('"%s","%s","successfully used pin","%s"' % (s_id,ref,pin_str))
     773                    s_logger.info('%s/%s successfully used PIN %s' % (s_id,ref,pin_str))
    774774                if student is None:
    775775                    err = "Student not found."
    776                     s_logger.info('"%s","not found in admission list"' % (ref))
     776                    s_logger.info('%s not found in admission list' % (ref))
    777777                    break
    778778                s_id = student.getId()
     
    781781                        if hasattr(self.portal_directories.students,s_id):
    782782                            err = "Please login with your Student Id %s and 10-digit PIN." % s_id
    783                             s_logger.info('"%s","%s", "repeatedly checked admission with pin", "%s"' % (s_id,ref,pin_str))
     783                            s_logger.info('%s/%s repeatedly checked admission with PIN %s' % (s_id,ref,pin_str))
    784784                            break
    785785                        else:
    786                             s_logger.info('"%s","%s","(non-member) repeatedly checked admission with pin", "%s"' % (s_id,ref,pin_str))
     786                            s_logger.info('%s/%s (non-member) repeatedly checked admission with PIN %s' % (s_id,ref,pin_str))
    787787                    else:
    788788                        err = "Unknown error" % s_id
    789                         s_logger.info('"%s","%s", "repeatedly activated service with pin", "%s"' % (s_id,ref,pin_str))
     789                        s_logger.info('%s/%s repeatedly activated service with PIN %s' % (s_id,ref,pin_str))
    790790                        break
    791791                try:
    792792                    student.getContent().makeStudentMember(s_id,password=pin[4:])
    793                     s_logger.info('"%s","%s", "has been created using pin", "%s"' % (s_id,ref,pin_str))
     793                    s_logger.info('%s/%s has been created using PIN %s' % (s_id,ref,pin_str))
    794794                except:
    795795                    err = "Please login with your Student Id %s and 10-digit PIN." % s_id
    796                     s_logger.info('"%s","%s", "could not be made a member with pin", "%s"' % (s_id,ref,pin_str))
     796                    s_logger.info('%s/%s could not be made a member with PIN %s' % (s_id,ref,pin_str))
    797797                    break
    798798            break
  • WAeUP_SRP/trunk/profiles/default/actionicons.xml

    r1477 r1571  
    5757              action_id="allocate_reserved_bed"
    5858              title="Allocate Reserved Bed" priority="100"
    59               icon_expr="bed_list_refresh.gif"/>             
     59              icon_expr="bed_list_refresh.gif"/>
     60 <action-icon category="object"
     61              action_id="release_bed"
     62              title="Relase Bed" priority="110"
     63              icon_expr="door_out.png"/>   
    6064 <action-icon category="folder" action_id="portlets"
    6165              title="Manage portlets" priority="270"
  • WAeUP_SRP/trunk/profiles/default/layouts/student_accommodation.xml

    r1449 r1571  
    110110  </property>
    111111  <property name="hidden_readonly_layout_modes"/>
    112   <property name="render_method">formatBed</property>
     112  <property name="render_method">getFormattedBed</property>
    113113 </widget>
    114114 <widget name="session" meta_type="String Widget">
  • WAeUP_SRP/trunk/profiles/default/layouts/student_accommodation_fe.xml

    r1449 r1571  
    7979  </property>
    8080  <property name="hidden_readonly_layout_modes"/>
    81   <property name="render_method">formatBed</property>
     81  <property name="render_method">getFormattedBed</property>
    8282 </widget>
    8383 <widget name="session" meta_type="String Widget">
  • WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_student_states.xml

    r1557 r1571  
    2121 <item key="courses_registered" msgid="">courses registered</item>
    2222 <item key="courses_validated" msgid="">courses validated</item>
    23  <item key="content_addable" msgid="">content addable</item>
    2423</object>
  • WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py

    r1456 r1571  
    1717from Products.CPSDocument.utils import getFormUidUrlArg
    1818
     19import logging
     20logger = logging.getLogger('Skins.waeup_edit')
     21
     22mtool = context.portal_membership
     23member = mtool.getAuthenticatedMember()
     24
    1925# Check flexible controls
    2026#context.editLayouts(REQUEST=REQUEST)
     
    2531if context.portal_type == "StudentStudyCourse":
    2632    if len(context.objectIds()) > 0:
    27         psm = 'Edit of StudyCourse is only possible if there are no levels'
     33        psm = 'Edit of StudentStudyCourse is only possible if there are no levels inside!'
    2834        args = getFormUidUrlArg(REQUEST)
    2935        args['portal_status_message'] = psm
     
    5864                                                  department = c_path[-3],
    5965                                                  )
     66            logger.info('%s edited %s (%s) of %s' % (member,context.id,course,student_id))
     67
    6068    elif context.portal_type == "StudentApplication":
    6169        entry_mode = ds.get('entry_mode')
     
    6472                                              entry_mode = entry_mode,
    6573                                             )
     74        logger.info('%s edited %s of %s' % (member,context.id,student_id))
    6675    elif context.portal_type == "StudentClearance":
    6776        matric_no = ds.get('matric_no')
     
    7079                                              matric_no = matric_no,
    7180                                             )
     81        logger.info('%s edited %s of %s' % (member,context.id,student_id))                                             
    7282    elif context.portal_type in ("StudentPersonal",):
    7383        name = "%(firstname)s %(middlename)s %(lastname)s" % ds
     
    8191        #if ds.get('sex'):
    8292        #    jamb_sex = 'F'
    83         # originally imported data must be kept; app_doc should not be changed here 
     93        # originally imported data must be kept; app_doc should not be changed here
    8494        #app_doc.edit(mapping={'jamb_lastname': name,
    8595        #                      'jamb_sex': jamb_sex
     
    91101                                              sex = ds.get('sex'),
    92102                                             )
     103        logger.info('%s edited %s of %s' % (member,context.id,student_id))
    93104    elif context.portal_type == "Course":
    94105        dd = {}
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py

    r1568 r1571  
    9191info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id)
    9292
    93 logger.info('%(student_id)s initiated online school fee payment, %(type_description)s %(amount)s N' % info)
     93logger.info('%(student_id)s initiated online school fee payment' % info)
    9494payment_fields = (('x_SiteID','site_id'),
    9595                  ('x_Redirect_url','callback_url'),
  • WAeUP_SRP/trunk/skins/waeup_epayment/simulate_callback.py

    r1568 r1571  
    1010validate = REQUEST.has_key("cpsdocument_edit_button")
    1111
     12import logging
     13logger = logging.getLogger('Skins.simulate_callback')
     14
    1215args = {}
    1316args['x_RespDesc'] = 'Simulated Callback'
     
    1720args['x_ApprAmt'] = REQUEST.get('x_amt')
    1821
     22
     23student_id = context.getStudentId()
     24logger.info('%s received simulated callback' % student_id)
     25
    1926from urllib import urlencode
    2027#url = "%s/epayment_cb/?%s" % (context.absolute_url(),urlencode(args))
  • WAeUP_SRP/trunk/skins/waeup_student/add_course_result.py

    r1520 r1571  
    1212add a StudentCourseResult object
    1313"""
     14
     15import logging
     16logger = logging.getLogger('Skins.add_course_result')
     17
    1418from urllib import urlencode
    1519try:
     
    2327aq_portal = context.portal_catalog.evalAdvancedQuery
    2428course_id = request.get('course_id')
     29
     30mtool = context.portal_membership
     31member = mtool.getAuthenticatedMember()
     32
     33
    2534d = context.getCourseInfo(course_id)
    2635args = {}
     
    2837while True:
    2938    if d['title'] == 'unknown':
    30         err = "No such course"
     39        err = "No such course!"
     40        logger.info('%s tried to add StudentCourseResult object %s for non-existing course' % (member,course_id))
    3141        break
    3242    if context.hasObject(course_id):
    33         err = "Course already exists"
     43        err = "Course already exists!"
     44        logger.info('%s tried to add StudentCourseResult object %s which is already in course list' % (member,course_id))
    3445        break
    3546    if context.hasObject("%s_co" % course_id):
    36         err = "Course already exists as carryover course"
     47        err = "Course already exists as carryover course!"
     48        logger.info('%s tried to add StudentCourseResult object %s which already exists as carryover course' % (member,course_id))
    3749        break
    3850    break
     
    4052if err:
    4153    args['course_id'] = course_id
    42     args['error'] = err
     54    #args['error'] = err
     55    args['portal_status_message'] = err
    4356    url = "%s?%s" % (context.absolute_url(),urlencode(args))
    4457    return request.RESPONSE.redirect(url)
     58
     59   
    4560cr_id = context.invokeFactory('StudentCourseResult',course_id)
    4661#set_trace()
     
    5065context.portal_workflow.doActionFor(cr,'close')
    5166args['course_id'] = course_id
     67
     68logger.info('%s added StudentCourseResult object %s' % (member,course_id))   
     69
    5270from urllib import urlencode
    5371url = "%s?%s" % (context.absolute_url(),urlencode(args))
  • WAeUP_SRP/trunk/skins/waeup_student/add_student.py

    r1422 r1571  
    1313acco_cat = context.portal_accommodation
    1414import logging
    15 logger = logging.getLogger('Student.Add')
     15logger = logging.getLogger('Skins.add_student')
    1616
    1717validate = REQUEST.has_key("cpsdocument_edit_button") and\
     
    6767student_rec = context.getFormattedStudentEntry(context.students_catalog(id = sid)[0])
    6868psm = "Student record with Id %s and Password %s has been created." % (sid,password)
    69 logger.info('"%s","created student","%s"' % (member,sid))
     69logger.info('%s created student %s' % (member,sid))
    7070return context.add_student_form(rendered = rendered,
    7171                                 #psm = "%s, %s" % (psm,ds),
  • WAeUP_SRP/trunk/skins/waeup_student/application_edit.py

    r1343 r1571  
    1616current = DateTime.DateTime()
    1717import logging
    18 logger = logging.getLogger('Student.Application.Edit')
     18logger = logging.getLogger('Skins.application_edit')
    1919
    2020# Until ajax posts directly to its own script...
     
    3030
    3131if info is None:
    32     logger.info('"anonymous access","%s"' % REQUEST.get('URL0'))
     32    logger.info('Anonymous user tried to access %s"' % REQUEST.get('URL0'))
    3333    return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    3434
     
    5656    elif cpsdocument_edit_and_view_button:
    5757        if 1: ## app_doc.passport is not None:
    58             logger.info('"%s", "proceeded to start clearance"' % (info['id']))
     58            logger.info('%s proceeded to start clearance' % (info['id']))
    5959            action = "/start_clearance"
    6060            base_url = student.absolute_url()
  • WAeUP_SRP/trunk/skins/waeup_student/change_password.py

    r1527 r1571  
    1414current = DateTime.DateTime()
    1515#pr = context.portal_registration
    16 logger = logging.getLogger('Student.change_password')
     16logger = logging.getLogger('Skins.change_password')
    1717validate = request.has_key("change_password")
    1818students_dir = context.portal_directories.students
     
    2424requested_id = context.getStudentId()
    2525if requested_id and not context.isStaff() and member_id != requested_id:
    26     logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     26    logger.info('%s tried to access %s' % (member_id,requested_id))
    2727    return None
    2828elif context.isStaff():
     
    7474args['__ac_name'] = student_id
    7575args['__ac_password'] = password
     76logger.info('%s changed password from %s to %s' % (member_id,old_password,password))
    7677from urllib import urlencode
    7778url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))
  • WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py

    r1217 r1571  
    1616current = DateTime.DateTime()
    1717import logging
    18 logger = logging.getLogger('Student.Clearance.Edit')
     18logger = logging.getLogger('Skins.clearance_edit')
    1919request = REQUEST
    2020
     
    7070    if cpsdocument_edit_button or result_edit_button:
    7171        psm = "Content changed!"
    72         logger.info('"%s","edited clearance of","%s"' % (member_id,student_id ))
     72        logger.info('%s edited clearance of %s' % (member_id,student_id ))
    7373        if clear_doc.clr_ac_pin == "":
    7474            res = context.portal_pins(student=member_id)
     
    9292                    missing = True
    9393            if missing:
    94                 logger.info('"%s","requested clearance with documents missing"' % (student_id))
     94                logger.info('%s requested clearance with documents missing' % (student_id))
    9595                psm = "You have not uploaded all necessary documents to request clearance!"
    9696            else:
    97                 logger.info('"%s","requested clearance"' % (student_id))
     97                logger.info('%s requested clearance' % (student_id))
    9898                info['clear_doc'].edit(mapping = {'request_date': current,})
    9999                wftool.doActionFor(info['clear'],'close')
     
    103103                    action = "/clearance_view"
    104104        elif acknowledge and info['review_state'] != "clearance_pin_entered":
    105             logger.info('"%s","repeatedly requested clearance"' % (student_id))
     105            logger.info('%s repeatedly requested clearance' % (student_id))
    106106            psm = "You have already requested clearance!"
    107107        else:
    108108            psm = "You must tick the acknowledgement check box before submission!"
    109109    elif clear_and_validate_button and info['review_state'] == "clearance_requested":
    110         logger.info('"%s","cleared","%s"' % (member_id,student_id ))
     110        logger.info('%s cleared %s' % (member_id,student_id ))
    111111        #from Products.zdb import set_trace
    112112        #set_trace()
     
    117117        psm = "This student is already cleared!"
    118118    elif reject_clearance_button:
    119         logger.info('"%s","rejected clearance for","%s"' % (member_id,student_id ))
     119        logger.info('%s rejected clearance for %s' % (member_id,student_id ))
    120120        wftool.doActionFor(info['clear'],'open')
    121121        wftool.doActionFor(info['student'],'reject_clearance')
  • WAeUP_SRP/trunk/skins/waeup_student/create_level.py

    r1552 r1571  
    2121response = request.RESPONSE
    2222redirect = response.redirect
    23 logger = logging.getLogger('Student.create_level')
     23logger = logging.getLogger('Skins.create_level')
    2424mtool = context.portal_membership
    2525member = mtool.getAuthenticatedMember()
     
    4646    level = getattr(context,current_level)
    4747    return response.redirect("%s" % level.absolute_url())
    48    
     48
    4949context.invokeFactory('StudentStudyLevel',"%s" % current_level)
    5050level = getattr(context,"%s" % current_level)
     
    6363        c_res = aq_courses(query)
    6464        if not c_res:
    65             logger.info('"%s","%s course not found in courses catalog"' % (student.id,co.CosCode))
     65            logger.info('%s", course %s not found in courses_catalog' % (student.id,co.CosCode))
    6666            continue
    6767        course_cat_entry = c_res[0]
     
    7373                score = int(co.Score)
    7474            except:
    75                 logger.info('"%s"," course %s invalid score %s"' % (student.id,
     75                logger.info('%s, course %s has invalid score %s"' % (student.id,
    7676                                                                    co.CosCode,
    7777                                                                    co.Score))
    7878                continue
    79             if int(c_res[0].passmark) <= score: 
     79            if int(c_res[0].passmark) <= score:
    8080                continue
    8181            carry_over = True
  • WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py

    r1474 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Accommodation.Info')
     15logger = logging.getLogger('Skins.getAccommodationInfo')
    1616import DateTime
    1717
     
    2929    requested_id = context.getStudentId()
    3030    if requested_id and not context.isStaff() and member_id != requested_id:
    31         logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     31        logger.info('%s tried to access %s' % (member_id,requested_id))
    3232        return None
    3333    elif context.isStaff():
     
    3737res = context.students_catalog(id=student_id)
    3838if len(res) != 1:
    39     logger.info('"%s","not found in students_catalog"')
     39    logger.info('%s not found in students_catalog' % student_id)
    4040    return None
    4141
  • WAeUP_SRP/trunk/skins/waeup_student/getApplicationInfo.py

    r1435 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Application.Info')
     15logger = logging.getLogger('Skins.getApplicationInfo')
    1616
    1717request = context.REQUEST
     
    2828requested_id = context.getStudentId()
    2929if requested_id and not context.isStaff() and member_id != requested_id:
    30     logger.info('"%s", "accessed application object of", "%s"' % (member_id,requested_id))
     30    logger.info('%s tried to access application object of %s' % (member_id,requested_id))
    3131    student_id = requested_id
     32    return None
    3233elif context.isStaff():
    3334    student_id = requested_id
  • WAeUP_SRP/trunk/skins/waeup_student/getClearanceInfo.py

    r1162 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Clearance.Info')
     15logger = logging.getLogger('Skins.getClearanceInfo')
    1616from DateTime import DateTime
    1717
     
    3030requested_id = context.getStudentId()
    3131if requested_id and not context.isStaff() and member_id != requested_id:
    32     logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     32    logger.info('%s tried to access %s' % (member_id,requested_id))
    3333    return None
    3434elif context.isStaff():
  • WAeUP_SRP/trunk/skins/waeup_student/getMemberInfo.py

    r1541 r1571  
    2828requested_id = context.getStudentId()
    2929if requested_id and not context.isStaff() and member_id != requested_id:
    30     logger.info('"%s", "accessed personal object of", "%s"' % (member_id,requested_id))
     30    logger.info('%s tried to access personal object of %s' % (member_id,requested_id))
    3131    student_id = requested_id
     32    return None
    3233elif context.isStaff():
    3334    student_id = requested_id
  • WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py

    r1530 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Statistics')
     15logger = logging.getLogger('Skins.getNewStudentStatistics')
    1616
    1717try:
     
    2121except:
    2222    evalAdvancedQuery = None
    23 logger.info('"%s","invoked new statistics"' % context.portal_membership.getAuthenticatedMember())
     23logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
    2424l = []
    2525if not context.isStaff():
     
    108108    if total:
    109109        dep['cleared_and_validated_percent'] = "%.0f" % round(cav*100/total)
    110        
     110
    111111    ora = len([s for s in fac_ids if s in or_ids])
    112112    dep['objection_raised'] = ora
  • WAeUP_SRP/trunk/skins/waeup_student/getPersonalInfo.py

    r1203 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Personal.Info')
     15logger = logging.getLogger('Skins.getPersonalInfo')
    1616
    1717request = context.REQUEST
     
    2828requested_id = context.getStudentId()
    2929if requested_id and not context.isStaff() and member_id != requested_id:
    30     logger.info('"%s", "accessed personal object of", "%s"' % (member_id,requested_id))
     30    logger.info('%s tried to access personal object of %s' % (member_id,requested_id))
    3131    student_id = requested_id
     32    return None
    3233elif context.isStaff():
    3334    student_id = requested_id
  • WAeUP_SRP/trunk/skins/waeup_student/getRegStatistics.py

    r1530 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Statistics')
     15logger = logging.getLogger('Skins.getRegStatistics')
    1616
    1717try:
     
    2121except:
    2222    evalAdvancedQuery = None
    23 logger.info('"%s","invoked reg statistics"' % context.portal_membership.getAuthenticatedMember())
     23logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
    2424l = []
    2525if not context.isStaff():
     
    8181    if total:
    8282        dep['courses_registered_percent'] = "%.0f" % round(creg*100/total)
    83        
     83
    8484    cval = len([s for s in fac_ids if s in cval_ids])
    8585    dep['courses_validated'] = cval
  • WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py

    r1551 r1571  
    2121except:
    2222    evalAdvancedQuery = None
    23 logger.info('%s invoked returning statistics' % context.portal_membership.getAuthenticatedMember())
     23logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
    2424l = []
    2525if not context.isStaff():
     
    5959    sum_ret += ret
    6060    sum_sfp += sfp
    61        
     61
    6262    l.append(dep)
    6363
  • WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py

    r1364 r1571  
    1 ## Script (Python) "getMaintenancePrefix"
     1## Script (Python) "getSchoolFeePrefix"
    22##bind container=container
    33##bind context=context
     
    1616    return None
    1717
    18 import logging   
    19 logger = logging.getLogger('EPayment.getSchoolFeePrefix')   
     18import logging
     19logger = logging.getLogger('Skins.getSchoolFeePrefix')
    2020
    2121student_id = context.getStudentId()
     
    2424                                     id = sbrain.course)
    2525if not res:
    26     logger.info('"%s","certificate not found", "%s"' % (student_id,course))
     26    logger.info('%s, certificate %s not found' % (student_id,course))
    2727    prefix = "--"
    2828else:
  • WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py

    r1543 r1571  
    2727if requested_id and not context.isStaff() and member_id != requested_id:
    2828    import logging
    29     logger = logging.getLogger('Student.SessionResults.Info')
    30     logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     29    logger = logging.getLogger('Skins.getSessionResults')
     30    logger.info('%s tried to access %s' % (member_id,requested_id))
    3131    return None
    3232elif context.isStaff():
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentBaseInfo.py

    r1369 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Base.Info')
     15logger = logging.getLogger('Skins.getStudentBaseInfo')
    1616from DateTime import DateTime
    1717
     
    2929requested_id = context.getStudentId()
    3030if requested_id and not context.isStaff() and member_id != requested_id:
    31     logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     31    logger.info('%s tried to access %s' % (member_id,requested_id))
    3232    return None
    3333elif context.isStaff():
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentFolderInfo.py

    r1472 r1571  
    1 ## Script (Python) "getStudentInfo"
     1## Script (Python) "getStudentFolderInfo"
    22##bind container=container
    33##bind context=context
     
    2121
    2222import logging
    23 logger = logging.getLogger('Student.Info')
     23logger = logging.getLogger('Skins.getStudentFolderInfo')
    2424
    2525
     
    3838        break
    3939    if member_id != requested_id:
    40         logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     40        logger.info('%s tried to access %s' % (member_id,requested_id))
    4141        student_id = member_id
    4242        mtool.assertViewable(context)
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r1286 r1571  
    2121
    2222import logging
    23 logger = logging.getLogger('Student.Info')
     23logger = logging.getLogger('Skins.getStudentInfo')
    2424
    2525
     
    4242            break
    4343        if member_id != requested_id:
    44             logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     44            logger.info('%s tried to access %s' % (member_id,requested_id))
    4545            student_id = member_id
    4646            mtool.assertViewable(context)
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyCourseInfo.py

    r1565 r1571  
    5353review_state = wftool.getInfoFor(context,'review_state',None)
    5454student_review_state = context.getStudentReviewState()
    55 if review_state != 'content_addable' and context.isStudent() and student_review_state = 'school_fee_paid':
     55if review_state != 'content_addable' and student_review_state == 'school_fee_paid': #and context.isStudent():
    5656    wftool.doActionFor(context,'close_for_edit')
    5757may_register = (student_review_state in ('school_fee_paid',)) and\
  • WAeUP_SRP/trunk/skins/waeup_student/getTransferInfo.py

    r1368 r1571  
    1 ## Script (Python) "getClearanceInfo"
     1## Script (Python) "getTransferInfo"
    22##bind container=container
    33##bind context=context
     
    1313"""
    1414import logging
    15 logger = logging.getLogger('Student.Transfer.Info')
     15logger = logging.getLogger('Skins.getTransferInfo')
    1616from DateTime import DateTime
    1717
     
    2929requested_id = context.getStudentId()
    3030if requested_id and not context.isStaff() and member_id != requested_id:
    31     logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
     31    logger.info('%s tried to access %s' % (member_id,requested_id))
    3232    return None
    3333elif context.isStaff():
  • WAeUP_SRP/trunk/skins/waeup_student/personal_edit.py

    r1457 r1571  
    1616current = DateTime.DateTime()
    1717import logging
    18 logger = logging.getLogger('Student.Personal.Edit')
     18logger = logging.getLogger('Skins.personal_edit')
    1919
    2020info = context.getPersonalInfo()
    2121
    2222if info is None:
    23     logger.info('"anonymous access","%s"' % REQUEST.get('URL0'))
     23    logger.info('Anonymous user tried to access %s' % REQUEST.get('URL0'))
    2424    return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    2525
     
    5353                                              sex = ds.get('sex'),
    5454                                             )
    55         logger.info('"%s", "edited personal data"' % (info['id']))
     55        logger.info('%s edited personal data' % (info['id']))
    5656        #action = ""
    5757        #base_url = student.absolute_url()
  • WAeUP_SRP/trunk/skins/waeup_student/raise_objection.py

    r1161 r1571  
    1414import DateTime
    1515import logging
    16 logger = logging.getLogger('Student.Objection')
     16logger = logging.getLogger('Skins.raise_objection')
    1717
    1818wf = context.portal_workflow
    1919info = context.getApplicationInfo()
    2020if not info:
    21     logger.info('"%s", "tried to access", "%s"' % (context.portal_membership.getAuthenticatedMember(),context.getStudentId()))
     21    logger.info('%s tried to access %s' % (context.portal_membership.getAuthenticatedMember(),context.getStudentId()))
    2222    return context.admission_form()
    2323current = DateTime.DateTime()
  • WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py

    r1510 r1571  
    1616aq_courses = context.courses_catalog.evalAdvancedQuery
    1717
     18import logging
     19logger = logging.getLogger('Skins.refresh_level')
     20
    1821current = DateTime.DateTime()
    1922request = context.REQUEST
     
    2124response = request.RESPONSE
    2225redirect = response.redirect
    23 logger = logging.getLogger('Student.create_level')
     26logger = logging.getLogger('Skins.refresh_level')
    2427mtool = context.portal_membership
    2528member = mtool.getAuthenticatedMember()
     
    5154        c_res = aq_courses(query)
    5255        if not c_res:
    53             logger.info('"%s","%s course not found in courses catalog"' % (student.id,co.CosCode))
     56            logger.info('%s, course %s not found in courses_catalog' % (student.id,co.CosCode))
    5457            continue
    5558        course_cat_entry = c_res[0]
     
    6063                score = int(co.Score)
    6164            except:
    62                 logger.info('"%s"," course %s invalid score %s"' % (student.id,
     65                logger.info('%s, course %s has invalid score %s' % (student.id,
    6366                                                                    co.CosCode,
    6467                                                                    co.Score))
    6568                continue
    66             if int(c_res[0].passmark) <= score: 
     69            if int(c_res[0].passmark) <= score:
    6770                continue
    6871            carry_over = True
     
    9699            course_result.getContent().edit(mapping=d)
    97100session.set('in_progress','finished')
     101logger.info('%s updated course list' % member)
    98102return
    99103return response.redirect("%s" % level.absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_student/register_courses.py

    r1513 r1571  
    1 ## Script (Python) "getStudyCourseInfo"
     1## Script (Python) "register_courses"
    22##bind container=container
    33##bind context=context
     
    2323member_id = str(member)
    2424import logging
    25 logger = logging.getLogger('Student.register_courses')
     25logger = logging.getLogger('Skins.register_courses')
    2626
    2727wftool = context.portal_workflow
     
    3030student = getattr(students_folder,context.getStudentId())
    3131wftool.doActionFor(student,'register_courses')
    32 logger.info('"%s","courses registered"' % student.getId())
     32logger.info('%s registered course list' % student.getId())
    3333return request.RESPONSE.redirect("%s" % context.absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_student/reject_courses.py

    r1515 r1571  
    1 ## Script (Python) "getStudyCourseInfo"
     1## Script (Python) "reject_courses"
    22##bind container=container
    33##bind context=context
     
    2323member_id = str(member)
    2424import logging
    25 logger = logging.getLogger('Student.reject_courses')
     25logger = logging.getLogger('Skins.reject_courses')
    2626
    2727wftool = context.portal_workflow
     
    3131student = getattr(students_folder,context.getStudentId())
    3232wftool.doActionFor(student,'reject_courses')
    33 logger.info('"%s","rejects course list for","%s"' % (member,student.getId()))
     33logger.info('%s rejected course list of %s' % (member,student.getId()))
    3434return request.RESPONSE.redirect("%s" % context.absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_student/request_transfer.py

    r1378 r1571  
    1414import logging
    1515from urllib import urlencode
    16 logger = logging.getLogger('Student.Transfer.Request')
     16logger = logging.getLogger('Skins_request_transfer')
    1717import DateTime
    1818lt = context.portal_layouts
     
    2828requested_id = context.getStudentId()
    2929if requested_id and not context.isStaff() and member_id != requested_id:
    30     logger.info('"%s", "accessed application object of", "%s"' % (member_id,requested_id))
     30    logger.info('%s tried to access object of %s' % (member_id,requested_id))
    3131    student_id = requested_id
     32    return None
    3233elif context.isStaff():
    3334    student_id = requested_id
     
    5051
    5152if paid:
    52     logger.info('"%s", "opened (paid) request transfer form of", "%s"' % (member_id,student_id))
     53    logger.info('%s opened (paid) request transfer form of %s' % (member_id,student_id))
    5354    return context.request_transfer_form(rendered = None,
    5455                                 psm = None,
     
    9192    payments = getattr(student,'payments')
    9293#from Products.zdb import set_trace; set_trace()
     94
     95logger.info('%s paid transfer form for %s' % (member_id,student_id))
    9396info = {}
    9497order_id = ds.get('pin_n')
  • WAeUP_SRP/trunk/skins/waeup_student/search_students.py

    r1557 r1571  
    1313"""
    1414import logging
    15 logger = logging.getLogger('Search.Timer')
     15logger = logging.getLogger('Skins.search_students')
    1616from DateTime import DateTime
    1717#
     
    8282                 In('localUsersWithRoles', ("user:%s" % member,))
    8383        res = evalAdvancedQuery(query)
     84        logger.info('ClearanceOfficer %s initiated student_search' % member)
    8485        faculties = []
    8586        if res:
     
    107108                 In('localUsersWithRoles', ("user:%s" % member,))
    108109        res = evalAdvancedQuery(query)
     110        logger.info('CourseAdviser %s initiated student_search' % member)
    109111        certificate_level = []
    110112        if res:
     
    168170        students_folder = context.portal_url.getPortalObject().campus.students
    169171        if hasattr(students_folder,term.strip()):
     172            logger.info('%s searches for student with id %s' % (member,term))
    170173            request.RESPONSE.redirect("%s/%s" % (students_folder.absolute_url(),term))
    171174        return context.search_students_form(rendered = rend,
     
    176179    elif what == "department":
    177180        res = context.students_catalog(department=term.strip())
     181        logger.info('%s searches for student in department %s' % (member,term))
    178182        search_set = [r.id for r in res]
    179183    elif what == "matric_no":
    180184        res = context.students_catalog(matric_no=term.strip())
     185        logger.info('%s searches for student with matric_no %s' % (member,term))
    181186        search_set = [r.id for r in res]
    182187    elif what == "jamb_reg_no":
     
    184189        st_u = "%s" % term.strip().upper()
    185190        res = aq_students(In('jamb_reg_no',(st_l,st_u)))
     191        logger.info('%s searches for student with jamb_reg_no %s' % (member,term))
    186192        search_set = [r.id for r in res]
    187193    elif what == "name":
    188194        pt = ('StudentPersonal')
    189195        query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip())
     196        logger.info('%s searches for student with name %s' % (member,term))
    190197        res = evalAdvancedQuery(query)
    191198        if res:
     
    201208    query = Eq('review_state',state)
    202209    review_res = evalAdvancedQuery(query)
     210   
     211    logger.info('%s searches for students in review_state %s' % (member,state))
     212   
    203213    if with_timer:
    204214        end = DateTime().timeTime()
  • WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py

    r1267 r1571  
    88current = DateTime.DateTime()
    99pr = context.portal_registration
    10 logger = logging.getLogger('Student.SetAccessData')
     10logger = logging.getLogger('Skins.set_access_data')
    1111validate = REQUEST.has_key("cpsdocument_edit_button")
    1212
     
    2121    sid = st_res[0].id
    2222else:
    23     logger.info('"%s","Studentobject does not exist"' % matric_no)
     23    logger.info('Student object with matric_no does not exist' % matric_no)
    2424res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',
    2525                      schema_id= 'student_returning',
     
    5353        #psm = "You are already registered please log in with your UserId %s" % sid
    5454        psm = ""
    55         logger.info('"%s","repeatedly tried to set password"' % sid)
     55        logger.info('%s repeatedly tried to set password' % sid)
    5656    except:
    5757        psm = "The system encountered an error. Please try again."
    58         logger.info('"%s","set_access error","%s"' % (sid,password))
     58        logger.info('%s, makeStudentMember error, password = %s' % (sid,password))
    5959if psm != '':
    6060    return context.set_access_data_form(rendered = res,
  • WAeUP_SRP/trunk/skins/waeup_student/start_clearance.py

    r1364 r1571  
    88pr = context.portal_registration
    99import logging
    10 logger = logging.getLogger('Student.Clearance.Start')
     10logger = logging.getLogger('Skins.start_clearance')
    1111
    1212#type_name = 'Student'
     
    2323if info is None:
    2424    member_id = str(context.portal_membership.getAuthenticatedMember())
    25     logger.info('"%s","tried to start clearance for", "%s"' % (member_id,request.get('PATH_INFO').split('/')[-2]))
     25    logger.info('%s tried to start clearance for %s' % (member_id,request.get('PATH_INFO').split('/')[-2]))
    2626    return redirect("%s/srp_invalid_access" % context.portal_url())
    2727app_doc = info['app_doc']
     
    5555    psm = "You have already entered a clearance pin!"
    5656    error = True
    57     logger.info('"%s", "tried to start clearance though already started"' % (info['id']))
     57    logger.info('%s tried to start clearance though already started' % (info['id']))
    5858elif psm == 'invalid':
    5959    psm = "Please correct your input!"
    6060    error = True
    61     logger.info('"%s","entered wrong clearance pin"' % (info['id']))
     61    logger.info('%s entered wrong clearance pin' % (info['id']))
    6262elif app_doc.passport is None:
    6363    #psm = "You must upload your passport picture before you can start the registration process!"
    6464    #error = True
    65     logger.info('"%s", "started clearance without passport picture"' % (info['id']))
     65    logger.info('%s started clearance without passport picture' % (info['id']))
    6666if error:
    6767    return context.clearance_pin_form(rendered = res,
     
    7474session.set("clicked","clicked")
    7575pin = str(ds.get('clr_ac_pin'))
    76 logger.info('"%s", "started clearance with pin", "%s"' % (info['id'],pin))
     76logger.info('%s started clearance with pin %s' % (info['id'],pin))
    7777wf.doActionFor(info['student'],'enter_clearance_pin')
    7878wf.doActionFor(info['clear'],'open')
     
    8989
    9090if info['penalty']:
    91     logger.info('"%s","started late clearance"' % (info['id']))
     91    logger.info('%s started late clearance' % (info['id']))
    9292
    9393return redirect("%s/clearance_edit_form" % info['clear'].absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt

    r1562 r1571  
    101101            <td align="left" valign="top" rowspan="3"></td>
    102102            <td align="left" valign="top">
    103                 <input type="submit" name="course_result_delete:method" value="Delete selected"
     103                <input type="submit" name="delete_course_result:method" value="Delete selected"
    104104                       class="destructive" i18n:attributes="value"
    105105                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
     
    127127                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
    128128                       />
    129                 <input type="submit" name="course_result_delete:method" value="Delete selected"
     129                <input type="submit" name="delete_course_result:method" value="Delete selected"
    130130                       class="destructive" i18n:attributes="value"
    131131                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
     
    159159                       />
    160160                <input tal:condition="python: review_state == 'school_fee_paid'"
    161                        type="submit" name="course_result_delete:method" value="Delete selected"
     161                       type="submit" name="delete_course_result:method" value="Delete selected"
    162162                       class="destructive" i18n:attributes="value"
    163163                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
     
    188188            <td><input type="text" name="course_id"
    189189                       tal:attributes="value request/course_id|nothing"/></td>
    190             <td tal:condition="request/error|nothing"
    191                 tal:content="request/error" />
    192190            <td colspan="2">
    193191              <input type="submit" name="add"
  • WAeUP_SRP/trunk/skins/waeup_student/validate_courses.py

    r1513 r1571  
    1 ## Script (Python) "getStudyCourseInfo"
     1## Script (Python) "validate_courses"
    22##bind container=container
    33##bind context=context
     
    2323member_id = str(member)
    2424import logging
    25 logger = logging.getLogger('Student.validate_courses')
     25logger = logging.getLogger('Skins.validate_courses')
    2626
    2727wftool = context.portal_workflow
     
    2929student = getattr(students_folder,context.getStudentId())
    3030wftool.doActionFor(student,'validate_courses')
    31 logger.info('"%s","validated courses for","%s"' % (member,student.getId()))
     31logger.info('%s validated course list for %s' % (member,student.getId()))
    3232return request.RESPONSE.redirect("%s" % context.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.