Changeset 1305 for WAeUP_SRP


Ignore:
Timestamp:
15 Jan 2007, 23:12:55 (18 years ago)
Author:
Henrik Bettermann
Message:

fully booked information simplified

Location:
WAeUP_SRP/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r1293 r1305  
    139139        #import pdb;pdb.set_trace()
    140140        if len(records) == 0:
    141             return -1,"No bed of this type available. This category is probably fully booked."
     141            return -2
    142142        rec = records[0]
    143143        self.modifyRecord(bed=rec.bed,student=student_id)
  • WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py

    r1293 r1305  
    7979        code,bed = pa.searchAndReserveBed(s_id,"%s" % (info['student_status']))
    8080        #code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
    81         if code < 0:
     81        if code == -1:
    8282            return context.accommodation_pin_edit_form(rendered = res,
    83                                  psm = "%s bed type=%s" % (bed,info['student_status']),
     83                                 psm = "%s" % bed,
    8484                                 mode = mode,
    8585                                 ds = ds,
    8686                                 )
     87        elif code == -2
     88            return context.accommodation_pin_edit_form(rendered = res,
     89                                 psm = "No bed available. Your category is already fully booked.",
     90                                 mode = mode,
     91                                 ds = ds,
     92                                 )       
    8793        student.invokeFactory('StudentAccommodation',acco_id)
    8894        acco = getattr(student,acco_id)
Note: See TracChangeset for help on using the changeset viewer.