Ignore:
Timestamp:
10 Oct 2006, 13:48:43 (18 years ago)
Author:
joachim
Message:

added

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  
    1414lt = context.portal_layouts
    1515pr = context.portal_registration
    16 
     16session = current.year()
     17acco_id = 'Acco_%s' % session
     18info = context.getStudentInfo()
     19student = info['student']
     20if info['acco']:
     21    return student.hostal_reservation_slip()
    1722res,psm,ds = lt.renderLayout(layout_id= 'student_acco_reserve',
    1823                      schema_id= 'student_acco_reserve',
     
    4449    pa = context.portal_accommodation
    4550    code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
    46     if code < 0:
     51    if code < -10:
    4752        return context.reserve_acco_form(rendered = res,
    4853                                 psm = bed,
     
    5156                                 ds = ds,
    5257                                 )
    53     else:
    54         return context.reserve_acco_form(rendered = res,
     58student.invokeFactory('StudentAccommodation',acco_id)
     59acco = getattr(student,acco_id)
     60ds['acco_res_date'] = current
     61ds['bed'] = bed
     62ds['session'] = session
     63acco.getContent().edit(mapping=ds)
     64return student.hostal_reservation_slip()
     65return context.reserve_acco_form(rendered = res,
    5566                                 psm = "successfully reserved bed %s" % bed,
    5667                                 firstlayout = True,
     
    5970                                 )
    6071
    61 
Note: See TracChangeset for help on using the changeset viewer.