Changeset 5221 for WAeUP_SRP/trunk


Ignore:
Timestamp:
13 Jun 2010, 16:43:18 (14 years ago)
Author:
Henrik Bettermann
Message:

use also student id for identification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Accommodation.py

    r5219 r5221  
    155155                format_error = format + ',"%(Error)s"'
    156156                no_certificate = "no certificate %s" % format
     157            student_id = bed.get('id')
    157158            matric_no = bed.get('matric_no')
    158159            jamb_reg_no = bed.get('jamb_reg_no')
    159             if matric_no != '':
     160            if student_id != '':
     161                res = students_cat(id = student_id)
     162                if not res:
     163                    bed['Error'] = "No such student"
     164                    no_import.append( format_error % bed)
     165                    continue
     166                student = res[0]
     167            elif matric_no != '':
    160168                res = students_cat(matric_no = matric_no)
    161169                if not res:
     
    172180                student = res[0]
    173181            else:
    174                 bed['Error'] = "No such student"
     182                bed['Error'] = "No student identification number provided"
    175183                no_import.append( format_error % bed)
    176184                continue
Note: See TracChangeset for help on using the changeset viewer.