Ignore:
Timestamp:
23 Nov 2018, 11:10:19 (6 years ago)
Author:
Henrik Bettermann
Message:

Add ReleaseExpiredAllocationsActionButton? which has previously only been used by Uniben.

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

Legend:

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

    r15246 r15250  
    24062406            self.request, self.omit_fields)
    24072407        students_utils = getUtility(IStudentsUtils)
     2408        note = None
     2409        n = grok.getSite()['hostels'].allocation_expiration
     2410        if n:
     2411            note = """
     2412<br /><br /><br /><br /><br /><font size="12">
     2413Please endeavour to pay your hostel maintenance charge within ${a} days
     2414 of being allocated a space or else you are deemed to have
     2415 voluntarily forfeited it and it goes back into circulation to be
     2416 available for booking afresh!</font>
     2417"""
     2418            note = _(note, mapping={'a': n})
     2419            portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     2420            note = translate(
     2421                note, 'waeup.kofa', target_language=portal_language)
    24082422        return students_utils.renderPDF(
    24092423            self, 'bed_allocation_slip.pdf',
    24102424            self.context.student, studentview,
    2411             omit_fields=self.omit_fields)
     2425            omit_fields=self.omit_fields,
     2426            note=note)
    24122427
    24132428class BedTicketRelocationView(UtilityView, grok.View):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r15234 r15250  
    32703270        bed.bed_type = u'regular_female_fr'
    32713271        self.app['hostels'][hostel.hostel_id].addBed(bed)
     3272        self.app['hostels'].allocation_expiration = 7
    32723273
    32733274        self.browser.open(self.login_path)
     
    33733374        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    33743375        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     3376        path = os.path.join(samples_dir(), 'bed_allocation_slip.pdf')
     3377        open(path, 'wb').write(self.browser.contents)
     3378        print "Sample PDF bed_allocation_slip.pdf written to %s" % path
    33753379        # Students can't relocate themselves.
    33763380        self.assertFalse('Relocate' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.