Ignore:
Timestamp:
1 Jun 2012, 06:21:18 (12 years ago)
Author:
Henrik Bettermann
Message:

Do not allow submission when application period has expired.

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

    r8565 r8589  
    926926        # might have forgotten to lock the form after changing the state
    927927        if state != PAID:
    928             self.flash(_('This form cannot be submitted. Wrong state!'))
     928            self.flash(_('The form cannot be submitted. Wrong state!'))
     929            return
     930        if not self.context.__parent__.enddate or (
     931            self.context.__parent__.enddate < datetime.now(pytz.utc)):
     932            self.flash(
     933                _('The form cannot be submitted. Application period has expired!'))
    929934            return
    930935        IWorkflowInfo(self.context).fireTransition('submit')
     936        # application_date is used in export files for sorting.
     937        # We can thus store utc.
    931938        self.context.application_date = datetime.utcnow()
    932939        self.context.locked = True
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r8562 r8589  
    315315    state = Attribute('The application state of an applicant')
    316316    display_fullname = Attribute('The fullname of an applicant')
    317     application_date = Attribute('Date of submission, used for export only')
     317    application_date = Attribute('UTC datetime of submission, used for export only')
    318318    password = Attribute('Encrypted password of a applicant')
    319319    application_number = Attribute('The key under which the record is stored')
Note: See TracChangeset for help on using the changeset viewer.