Ignore:
Timestamp:
16 Jan 2025, 02:08:45 (11 hours ago)
Author:
Henrik Bettermann
Message:

CreateAllStudentsPage: Stop creation after 1000 students to avoid write
conflicts which sill occur even though transactions have formerly been
commited.

File:
1 edited

Legend:

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

    r17850 r17985  
    775775        n = 0
    776776        for result in results:
    777             n += 1
    778777            if container_only and result.__parent__ is not self.context:
    779778                continue
     779            n += 1
    780780            success, msg = result.createStudent(view=self)
    781781            if success:
     
    785785                    (result.applicant_id, self.url(result, 'manage'), msg))
    786786            if not n % 1000:
    787                 transaction.commit()
     787                # Stop after 1000 students to avoid write conflicts which sill
     788                # occur even though transactions have formerly been commited.
     789                break
     790        self.flash(_('Finished.'))
    788791        grok.getSite()['configuration'].maintmode_enabled_by = None
     792        self.n = n
    789793        self.successful = ', '.join(created)
    790794        self.failed = failed
Note: See TracChangeset for help on using the changeset viewer.