Changeset 1384 for WAeUP_SRP/trunk


Ignore:
Timestamp:
1 Feb 2007, 09:21:47 (18 years ago)
Author:
Henrik Bettermann
Message:

fixed 3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_utilities/deleteStudentByMatricNo.py

    r1383 r1384  
    2626if str(member) not in ('admin','joachim') or matric_no is None:
    2727    return
     28   
     29   
     30# remove from students_catalog   
     31
    2832res = st_cat(matric_no=matric_no)
    2933if len(res) != 1:
     
    3135    logger.info(msg)
    3236    return msg
     37else:
     38    stbrain = res[0]
     39    student_id = stbrain.id
     40    st_cat.deleteRecord(student_id)
     41    msg = "Student with matric_no %s and student_id %s removed from students_catalog" % (matric_no,student_id)
     42    output = []
     43    logger.info(msg)
     44    output.append(msg)
    3345
    34 stbrain = res[0]
    35 #from Products.zdb import set_trace;set_trace()
    36 student_id = stbrain.id
    37 st_cat.deleteRecord(student_id)
    38 msg = "Student with matric_no %s and student_id %s removed from returning_import" % (matric_no,student_id)
     46# remove from returning_import
    3947
    40 res_deleted = []
    41 output = []
    4248res_ret = ret_imp(matric_no=matric_no)
    4349if len(res_ret) != 1:
     
    4955logger.info(msg)
    5056output.append(msg)
     57
     58# remove from results_import
     59
     60res_deleted = []
    5161res_res = res_imp(matric_no=matric_no)
    5262if len(res_res) > 0:
     
    5969output.append(msg)
    6070logger.info(msg)
     71
     72# remove from directory
     73
    6174if hasattr(stdir, student_id):
    6275    stdir.deleteEntry(student_id)
     
    6679output.append(msg)
    6780logger.info(msg)
     81
     82# remove objects
     83
    6884if hasattr(students,student_id):
    6985    students.manage_delObjects((student_id),)
     
    7389output.append(msg)
    7490logger.info(msg)
     91
    7592return "\n".join(output)
     93
Note: See TracChangeset for help on using the changeset viewer.