Changeset 1255 for WAeUP_SRP/trunk


Ignore:
Timestamp:
10 Jan 2007, 00:24:40 (18 years ago)
Author:
joachim
Message:

increaselevels

Location:
WAeUP_SRP/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTool.py

    r1250 r1255  
    168168        validlevel = False
    169169        try:
    170             int(level)
     170            il = int(level) + 100
     171            level = "%s" % il
    171172            validlevel = True
    172173        except:
     
    179180                level = erg[0].Level
    180181            try:
    181                 int(level)
     182                il = int(level) + 100
     183                level = "%s" % il
    182184                em = '"%s","fixed Level from results_import","%s"' % (student.matric_no,erg[0].Level)
    183185                logger.info(em)
  • WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py

    r1249 r1255  
    5858                    )
    5959s_brain = res[0]
     60info['error'] = None
    6061info['matric_no']=s_brain.matric_no
    6162info['jamb_reg_no']=s_brain.jamb_reg_no
     
    100101        #from Products.zdb import set_trace; set_trace()
    101102        certificate = c_brain.getObject().getContent()
    102         if int(s_brain.level) +100 == int(certificate.end_level):
     103        try:
     104            certlevel = int(certificate.end_level)
     105        except:
     106            info["error"] = '"no end_level for","%s"' % c_brain.getId
     107            return info
     108        try:
     109            studentlevel = int(s_brain.level) + 100
     110        except:
     111            info["error"] = '"no level for","%s"' % s_brain.getId
     112            return info
     113        if studentlevel >= certlevel:
    103114            bt = "fi"
    104115d['sex'] = 'male'
  • WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py

    r1183 r1255  
    5353                      button = button
    5454                      )
    55 if psm == 'invalid':
     55if psm == 'invalid' or info['error'] is not None:
     56    member_id = str(context.portal_membership.getAuthenticatedMember())
     57    logger.info('"%s", %s' % (member_id,info['error'] ))
     58    if psm == 'invalid':
     59        psm = "please correct your input"
     60    else:
     61        psm = "Error in Data, unable to reserve bed."
    5662    return context.accommodation_pin_edit_form(rendered = res,
    57                                  psm = "Please correct your input!",
    5863                                 #psm = "%s, %s" % (psm,ds),
    5964                                 mode = mode,
  • WAeUP_SRP/trunk/skins/waeup_utilities/createReturningStudent.py

    r1253 r1255  
    1919logger = logging.getLogger('createReturningStudent')
    2020
    21 #if str(member) not in ("admin","joachim"):
    22 #    return "not possible"
    23 
    24 
    25 #defined in WAeUPTool.py
    26 
    27 # def createOne(student_brain):
    28 #     sid = context.waeup_tool.generateStudentId('?')
    29 #     students_folder.invokeFactory('Student', sid)
    30 #     student = getattr(students_folder,sid)
    31 #     wftool.doActionFor(student,'return')
    32 #     student.manage_setLocalRoles(sid, ['Owner',])
    33 #     jamb_reg_no = student_brain.Entryregno,
    34 #     context.students_catalog.addRecord(id = sid,
    35 #                                        matric_no = matric_no,
    36 #                                        jamb_reg_no = jamb_reg_no,
    37 #                                        sex = student_brain.Sex == "F",
    38 #                                        name = "%s %s %s" % (student_brain.Firstname,
    39 #                                                             student_brain.Middlename,
    40 #                                                             student_brain.Lastname)
    41 #                                     )
    42 #     return sid,jamb_reg_no
    43 
    4421if not matric_no:
    4522    return "No MatricNo"
     
    5229        return "MatricNo %s not found in Returning Table" % matric_no
    5330    student_brain = res[0]
    54     sid,jamb_reg_no = context.waeup_tool.createOne(student_brain)
     31    sid,jamb_reg_no = context.waeup_tool.createOne(students_folder,student_brain,'?')
    5532    logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
    5633    return "Student MatricNo %s, StudentId %s Jamb %s created" % (matric_no,sid,jamb_reg_no)
     
    6643        continue
    6744    if count > 100:
    68         context.waeup_tool.createOne(student,commit=True)
     45        context.waeup_tool.createOne(students_folder,student,'Z',commit=True)
    6946        logger.info('"%s","Commited Students","%s", "%s" ' % (member,count,total))
    7047        total += count
    7148        count = 1
     49        if total > 500:
     50            break
    7251    else:
    73         context.waeup_tool.createOne(student)
    74         count += 1
     52        for letter in ('ABCDEFGHKLMNPQRSTUVWXY'):
     53            context.waeup_tool.createOne(students_folder,student,letter)
     54            count += 1
    7555logger.info('"%s","Create Students finish","%s"' % (member,total))
Note: See TracChangeset for help on using the changeset viewer.