Changeset 639 for WAeUP_SRP/trunk/skins/waeup_accommodation
- Timestamp:
- 10 Oct 2006, 13:48:43 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_accommodation
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_acco.py
r636 r639 14 14 lt = context.portal_layouts 15 15 pr = context.portal_registration 16 16 session = current.year() 17 acco_id = 'Acco_%s' % session 18 info = context.getStudentInfo() 19 student = info['student'] 20 if info['acco']: 21 return student.hostal_reservation_slip() 17 22 res,psm,ds = lt.renderLayout(layout_id= 'student_acco_reserve', 18 23 schema_id= 'student_acco_reserve', … … 44 49 pa = context.portal_accommodation 45 50 code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status'))) 46 if code < 0:51 if code < -10: 47 52 return context.reserve_acco_form(rendered = res, 48 53 psm = bed, … … 51 56 ds = ds, 52 57 ) 53 else: 54 return context.reserve_acco_form(rendered = res, 58 student.invokeFactory('StudentAccommodation',acco_id) 59 acco = getattr(student,acco_id) 60 ds['acco_res_date'] = current 61 ds['bed'] = bed 62 ds['session'] = session 63 acco.getContent().edit(mapping=ds) 64 return student.hostal_reservation_slip() 65 return context.reserve_acco_form(rendered = res, 55 66 psm = "successfully reserved bed %s" % bed, 56 67 firstlayout = True, … … 59 70 ) 60 71 61
Note: See TracChangeset for help on using the changeset viewer.