Changeset 17550


Ignore:
Timestamp:
18 Aug 2023, 04:24:57 (13 months ago)
Author:
Henrik Bettermann
Message:

Add logging messages before after creating students from applicants.

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

Legend:

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

    r17245 r17550  
    755755
    756756    def update(self):
     757        ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
     758        applicants_root = grok.getSite()['applicants']
    757759        grok.getSite()['configuration'].maintmode_enabled_by = u'admin'
     760        applicants_root.logger.info('%s - started in %s' % (
     761            ob_class, self.context.__name__))
    758762        transaction.commit()
    759763        # Wait 10 seconds for all transactions to be finished.
     
    778782                failed.append(
    779783                    (result.applicant_id, self.url(result, 'manage'), msg))
    780                 ob_class = self.__implemented__.__name__.replace(
    781                     'waeup.kofa.','')
    782784        grok.getSite()['configuration'].maintmode_enabled_by = None
    783785        self.successful = ', '.join(created)
    784786        self.failed = failed
     787        applicants_root.logger.info('%s - created in %s: %s' % (
     788            ob_class, self.context.__name__, self.successful))
    785789        return
    786790
     
    14031407        site = grok.getSite()
    14041408        kofa_utils = getUtility(IKofaUtils)
    1405         ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
    14061409        failed = ''
    14071410        emails_sent = 0
     
    18901893        site = grok.getSite()
    18911894        kofa_utils = getUtility(IKofaUtils)
    1892         ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
    18931895        failed = ''
    18941896        emails_sent = 0
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py

    r16545 r17550  
    304304        self.assertFalse('Failed records' in self.browser.contents)
    305305        self.assertTrue('Successfully created records' in self.browser.contents)
     306        logcontent = open(logfile).read()
     307        self.assertTrue('applicants.browser.CreateAllStudentsPage - started in app2021'
     308        in logcontent)
     309        self.assertTrue('%s - Student record created (K1000000)' % self.applicant.applicant_id
     310        in logcontent)
     311        self.assertTrue('applicants.browser.CreateAllStudentsPage - created in app2021: %s' % self.applicant.applicant_id
     312        in logcontent)
    306313
    307314    def test_hidden_batch_copying_all(self):
     
    321328        self.browser.open(self.root_path + '/createallstudents')
    322329        self.assertTrue('Successfully created records:' in self.browser.contents)
     330        logcontent = open(logfile).read()
     331        self.assertTrue('applicants.browser.CreateAllStudentsPage - started in applicants'
     332        in logcontent)
     333        self.assertTrue('%s - Student record created (K1000000)' % self.applicant.applicant_id
     334        in logcontent)
     335        self.assertTrue('applicants.browser.CreateAllStudentsPage - created in applicants: %s' % self.applicant.applicant_id
     336        in logcontent)
    323337
    324338    def test_copier_wo_passport(self):
Note: See TracChangeset for help on using the changeset viewer.