Changeset 14951


Ignore:
Timestamp:
9 Feb 2018, 18:49:18 (7 years ago)
Author:
Henrik Bettermann
Message:

Do not display applicant id and error messages in flash message box. This causes an internal server error if list is too long. Show error messages on a 'Student Record Creation Report' page instead.

Location:
main/waeup.kofa/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r14950 r14951  
    55=======================
    66
    7 * Display applicant id and error messages in flash message box if
    8   student creation has failed.
     7* Add 'Student Record Creation' Report page.
    98
    109* Add `CreateStudents` permission and `StudentsCreator` role.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r14949 r14951  
    685685        return
    686686
    687 class CreateAllStudentsPage(UtilityView, grok.View):
     687class CreateAllStudentsPage(KofaPage):
    688688    """Create all student objects from applicant data
    689689    in the root container or in a specific applicants container only.
     
    693693    grok.name('createallstudents')
    694694    grok.require('waeup.createStudents')
     695    label = _('Student Record Creation Report')
    695696
    696697    def update(self):
     
    716717                created.append(result.applicant_id)
    717718            else:
    718                 failed.append('%s (%s)' % (result.applicant_id, msg))
     719                failed.append(
     720                    (result.applicant_id, self.url(result, 'manage'), msg))
    719721                ob_class = self.__implemented__.__name__.replace(
    720722                    'waeup.kofa.','')
    721723                applicants_root.logger.info(
    722724                    '%s - %s - %s' % (ob_class, result.applicant_id, msg))
     725
    723726        grok.getSite()['configuration'].maintmode_enabled_by = None
    724         if len(created):
    725             self.flash(_('${a} students successfully created.',
    726                 mapping = {'a': len(created)}))
    727         if len(failed):
    728             self.flash(_('Student creation failed: ${a}',
    729                 mapping = {'a':', '.join(failed)}), type='danger')
    730         if not len(created) and not len(failed):
    731             self.flash(_('No record found.'), type='warning')
    732         self.redirect(self.url(self.context))
    733         return
    734 
    735     def render(self):
    736         return
     727        self.successful = ', '.join(created)
     728        self.failed = failed
     729        return
     730
    737731
    738732class ApplicationFeePaymentAddPage(UtilityView, grok.View):
Note: See TracChangeset for help on using the changeset viewer.