Changeset 3169 for WAeUP_SRP/base/skins/waeup_accommodation
- Timestamp:
- 15 Feb 2008, 08:06:37 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_accommodation/change_bed.py
r3165 r3169 46 46 allocated_bed = res[0] 47 47 if allocated_bed.bed_type == status: 48 logger.info('Status %s of %s has not changed ' % (status,student_id))48 logger.info('Status %s of %s has not changed.' % (status,student_id)) 49 49 psm='Student status has not changed!' 50 50 break 51 51 #return redirect("%s/%s/%s/waeup_document_view?portal_status_message=%s" % (students.absolute_url(),student_id,info['acco_id'],psm)) 52 logger.info('Bed status %s of %s has changed to %s ' % (allocated_bed.bed_type,student_id,status))52 logger.info('Bed status %s of %s has changed to %s.' % (allocated_bed.bed_type,student_id,status)) 53 53 query = Eq('bed_type',status) & Eq('student',context.portal_accommodation.not_occupied) 54 54 records = context.portal_accommodation.evalAdvancedQuery(query) 55 55 if len(records) < 1: 56 psm=' New bed allocation for %s failed, No bed free in category %s' % (student_id,status)56 psm='Bed change for %s failed, no free bed in category %s.' % (student_id,status) 57 57 logger.info(psm) 58 psm='Bed change failed!'59 58 break 60 59 beds.modifyRecord(bed=allocated_bed.bed,student=beds.not_occupied) … … 76 75 #acco_doc = info['acco_doc'] 77 76 #acco_doc.edit(mapping={'bed':"-- cancelled by officer due to failed bed change request --"}) 78 logger.info(' New bed allocationfor %s failed, code = %s' % (student_id,code))77 logger.info('Bed change for %s failed, code = %s' % (student_id,code)) 79 78 #logger.info('%s cancelled booking of bed %s by %s' % (member,bed,student_id)) 80 79 psm='Bed change failed!' … … 82 81 83 82 info = {} 84 records = [r for r in beds() if r.student ]83 records = [r for r in beds() if r.student and r.student != beds.not_occupied] 85 84 list = [] 86 85 to_modify = [] … … 91 90 continue 92 91 elif r.bed_type == sbt: 93 list.append("Student %s bed_type %s ok" % (r.student,r.bed_type))92 #list.append("Student %s bed_type %s ok" % (r.student,r.bed_type)) 94 93 continue 95 94 list.append("Student %s bed_type %s != %s" % (r.student, 96 95 r.bed_type, 97 96 info['student_status'])) 98 to_modify.append((r.bed,r.student,info['student_status'],info['acco_doc'])) 97 #to_modify.append((r.bed,r.student,info['student_status'],info['acco_doc'])) 98 99 return "\r".join(list) 100 99 101 for former_bed, student, status,acco_doc in to_modify: 100 102 beds.modifyRecord(bed=former_bed,student='')
Note: See TracChangeset for help on using the changeset viewer.