Changeset 9424 for main/waeup.kofa/trunk


Ignore:
Timestamp:
26 Oct 2012, 17:17:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Fix docstrings.

In my old ZODB which I used for testing there were orphaned catalog entries. I don't know why. The tests show clearly that the catalog is updated whenever a hostel is removed or cleared. However, to be 100% that nothing goes wrong I added some extra safety belts.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/accommodation.py

    r9423 r9424  
    5858
    5959class BedTicket(grok.Model):
    60     """This is a bed ticket which shows that the student has booked a bed
    61     and paid the maintenance fee.
     60    """This is a bed ticket which shows that the student has booked a bed.
    6261    """
    6362    grok.implements(IBedTicket, IStudentNavigation)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9423 r9424  
    13421342            current_session = str(student['studycourse'].current_session)
    13431343            if not student['accommodation'].has_key(current_session):
    1344                 self.flash(_('You have not yet booked a bed.'))
     1344                self.flash(_('You have not yet booked accommodation.'))
    13451345                self.redirect(self.url(self.context))
    13461346                return
     
    15891589            # If bed space has been manually allocated use this bed
    15901590            bed = [entry for entry in entries][0]
     1591            # Safety belt for paranoids: Does this bed really exist on portal?
     1592            # XXX: Can be remove if nobody complains.
     1593            if bed.__parent__.__parent__ is None:
     1594                self.flash(_('System error: Please contact the adminsitrator.'))
     1595                return
    15911596        else:
    15921597            # else search for other available beds
     
    15981603                students_utils = getUtility(IStudentsUtils)
    15991604                bed = students_utils.selectBed(available_beds)
     1605                # Safety belt for paranoids: Does this bed really exist in portal?
     1606                # XXX: Can be remove if nobody complains.
     1607                if bed.__parent__.__parent__ is None:
     1608                    self.flash(_('System error: Please contact the adminsitrator.'))
     1609                    return
    16001610                bed.bookBed(student.student_id)
    16011611            else:
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r9423 r9424  
    602602
    603603    bed_coordinates = schema.TextLine(
    604         title = _(u'Bed Coordinates'),
     604        title = _(u'Allocated Bed'),
    605605        required = True,
    606606        readonly = False,
     
    608608
    609609    bed_type = schema.TextLine(
    610         title = _(u'Bed Type'),
     610        title = _(u'Requested Bed Type'),
    611611        required = True,
    612612        readonly = False,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9423 r9424  
    20532053        self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
    20542054        self.browser.getControl("Create ticket").click()
    2055         self.assertMatches('...You have not yet booked a bed...',
     2055        self.assertMatches('...You have not yet booked accommodation...',
    20562056                           self.browser.contents)
    20572057        # We continue this test in test_student_accommodation
Note: See TracChangeset for help on using the changeset viewer.