Ignore:
Timestamp:
13 Feb 2012, 15:29:21 (13 years ago)
Author:
Henrik Bettermann
Message:

Add ReindexPaymentsPage?. This view can be called through the URL and works perfectly for all kinds of catalogs.

File:
1 edited

Legend:

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

    r7629 r7638  
    5959from waeup.sirp.students.studylevel import StudentStudyLevel, CourseTicket
    6060from waeup.sirp.students.vocabularies import StudyLevelSource
     61from waeup.sirp.students.utils import reindexPayments
    6162from waeup.sirp.browser.resources import toggleall
    6263from waeup.sirp.hostels.hostel import NOT_OCCUPIED
     
    18581859            self.flash('An smtp server error occurred.')
    18591860        return
     1861
     1862class ReindexPaymentsPage(UtilityView, grok.View):
     1863    """ Reindex view
     1864    """
     1865    grok.context(IUniversity)
     1866    grok.name('reindex')
     1867    grok.require('waeup.manageUniversity')
     1868
     1869    def update(self,ctlg=None):
     1870        if ctlg is None:
     1871            self.flash('No catalog name provided.')
     1872            return
     1873        cat = queryUtility(ICatalog, name='%s_catalog' % ctlg)
     1874        if cat is None:
     1875            self.flash('%s_catalog does not exist' % ctlg)
     1876            return
     1877        cat.updateIndexes()
     1878        self.flash('%s%s reindexed.' % (ctlg[0].upper(),ctlg[1:]))
     1879        return
     1880
     1881    def render(self):
     1882        self.redirect(self.url(self.context, '@@index'))
     1883        return
Note: See TracChangeset for help on using the changeset viewer.