Changeset 3408
- Timestamp:
- 2 Apr 2008, 16:07:32 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTables.py
r3406 r3408 497 497 elif len(records) > 1: 498 498 logger.info('%s found more than one (reserved) bed' % (student_id)) 499 return -3,'more than one bed' 499 return -3,'more than one bed' 500 500 query = Eq('bed_type',bed_type) & Eq('student',NOT_OCCUPIED) 501 501 records = self.evalAdvancedQuery(query,sortSpecs=('sort_id','bed')) 502 502 if len(records) == 0: 503 logger.info(' No bed %s available for %s' % (bed_type,student_id))503 logger.info('no bed %s available for %s' % (bed_type,student_id)) 504 504 return -2,"no bed" 505 505 rec = records[0] -
WAeUP_SRP/base/skins/waeup_accommodation/change_bed.py
r3406 r3408 46 46 #break 47 47 elif res[0].bed_type.endswith("reserved"): 48 logger.info( 'found reserved bed %s'% res[0].bed)49 pass 50 else: 48 logger.info("found reserved bed %s which won't be released" % res[0].bed) 49 pass 50 else: 51 51 allocated_bed = res[0] 52 52 if allocated_bed.bed_type == status: … … 74 74 acco_doc = info['acco_doc'] 75 75 acco_doc.edit(mapping=d) 76 if code > 0: 77 psm = 'Bed changed!' 76 78 logger.info('Bed %s allocated to %s' % (bed,student_id)) 77 psm='Bed changed!' 78 break 79 logger.info('Bed change for %s failed, code = %s' % (student_id,code)) 80 psm='Bed change failed!' 79 elif code == -1: 80 psm = 'A reserved bed has been allocated.' 81 elif code == -2: 82 psm = 'No bed %s for %s available!' % (status,student_id) 83 else: 84 psm = 'Bed change failed!' 81 85 break 82 86 return redirect("%s/%s/%s/waeup_document_view?portal_status_message=%s" % (students.absolute_url(),student_id,info['acco_id'],psm))
Note: See TracChangeset for help on using the changeset viewer.