Ignore:
Timestamp:
10 Jan 2018, 14:44:49 (7 years ago)
Author:
Henrik Bettermann
Message:

Do no longer hide the 'Create students' buttons but switch the portal to
maintenance mode to ensure that nobody can enter the portal during
record creation except for user 'admin'. This guarantees that record
creation is only started once.

File:
1 edited

Legend:

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

    r13951 r14934  
    167167    grok.order(4)
    168168
     169creation_warning = _(
     170    "'The creation process may take a considerably long time "
     171    "depending on the number of student records to be created "
     172    "(appr. 0.5s per student). "
     173    "All users will be logged out and the portal will be in "
     174    "maintenance mode during record creation. You have to login again after "
     175    "creation process has finished. "
     176    "Do you really want to start the process now?'")
     177
    169178class ApplicantsRootCreateStudentsActionButton(ManageActionButton):
    170179    grok.order(3)
     
    177186
    178187    @property
    179     def target_url(self):
    180         if self.target and self.request.principal.id == 'admin':
    181             return self.view.url(self.view.context, self.target)
    182         return
     188    def onclick(self):
     189        return "return window.confirm(%s);" % creation_warning
    183190
    184191class ApplicantsContainerCreateStudentsActionButton(ManageActionButton):
     
    192199
    193200    @property
    194     def target_url(self):
    195         if self.target and self.request.principal.id == 'admin':
    196             return self.view.url(self.view.context, self.target)
    197         return
     201    def onclick(self):
     202        return "return window.confirm(%s);" % creation_warning
    198203
    199204class ApplicantViewActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.