Changeset 3406 for WAeUP_SRP/base/skins/waeup_accommodation
- Timestamp:
- 2 Apr 2008, 07:16:08 (17 years ago)
- Location:
- WAeUP_SRP/base/skins/waeup_accommodation
- Files:
-
- 1 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_accommodation/change_bed.py
r3206 r3406 43 43 psm = 'No bed allocated for %s' % (student_id) 44 44 logger.info(psm) 45 break 46 allocated_bed = res[0] 47 if allocated_bed.bed_type == status: 48 logger.info('Status %s of %s has not changed.' % (status,student_id)) 49 psm='Student status has not changed!' 50 break 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)) 53 query = Eq('bed_type',status) & Eq('student',context.portal_accommodation.not_occupied) 54 records = context.portal_accommodation.evalAdvancedQuery(query) 55 if len(records) < 1: 56 psm='Bed change for %s failed, no free bed in category %s.' % (student_id,status) 57 logger.info(psm) 58 break 59 beds.modifyRecord(bed=allocated_bed.bed,student=beds.not_occupied) 60 logger.info('Bed %s released' % (allocated_bed.bed)) 45 pass 46 #break 47 elif res[0].bed_type.endswith("reserved"): 48 logger.info('found reserved bed %s' % res[0].bed) 49 pass 50 else: 51 allocated_bed = res[0] 52 if allocated_bed.bed_type == status: 53 logger.info('Status %s of %s has not changed.' % (status,student_id)) 54 psm='Student status has not changed!' 55 break 56 #return redirect("%s/%s/%s/waeup_document_view?portal_status_message=%s" % (students.absolute_url(),student_id,info['acco_id'],psm)) 57 logger.info('Bed status %s of %s has changed to %s.' % (allocated_bed.bed_type,student_id,status)) 58 query = Eq('bed_type',status) & Eq('student',context.portal_accommodation.not_occupied) 59 records = context.portal_accommodation.evalAdvancedQuery(query) 60 if len(records) < 1: 61 psm='Bed change for %s failed, no free bed in category %s.' % (student_id,status) 62 logger.info(psm) 63 break 64 beds.modifyRecord(bed=allocated_bed.bed,student=beds.not_occupied) 65 logger.info('Bed %s released' % (allocated_bed.bed)) 61 66 code,bed = beds.searchAndReserveBed(student_id,status) 62 if code > 0:67 if code > -2: 63 68 d = {} 64 69 d['bed'] = bed … … 72 77 psm='Bed changed!' 73 78 break 74 #return redirect("%s/%s/%s/waeup_document_view?portal_status_message=%s" % (students.absolute_url(),student_id,info['acco_id'],psm))75 #acco_doc = info['acco_doc']76 #acco_doc.edit(mapping={'bed':"-- cancelled by officer due to failed bed change request --"})77 79 logger.info('Bed change for %s failed, code = %s' % (student_id,code)) 78 #logger.info('%s cancelled booking of bed %s by %s' % (member,bed,student_id))79 80 psm='Bed change failed!' 81 break 80 82 return redirect("%s/%s/%s/waeup_document_view?portal_status_message=%s" % (students.absolute_url(),student_id,info['acco_id'],psm)) 81 83 -
WAeUP_SRP/base/skins/waeup_accommodation/release_bed.py
r3049 r3406 44 44 acco_cat.modifyRecord(bed=allocated_bed.bed,student=acco_cat.not_occupied) 45 45 acco_doc = context.getContent() 46 acco_doc.edit(mapping={'bed':"-- cancelled by section officer --" })46 acco_doc.edit(mapping={'bed':"-- cancelled by section officer --",'acco_maint_fee':""}) 47 47 logger.info('%s released bed of %s' % (member_id,student_id)) 48 48 return redirect("%s" % (context.absolute_url()))
Note: See TracChangeset for help on using the changeset viewer.