Changeset 16275


Ignore:
Timestamp:
9 Oct 2020, 07:49:18 (4 years ago)
Author:
Henrik Bettermann
Message:

Add ApplicantEmailSource (not used and tested in base package).

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

Legend:

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

    r16266 r16275  
    441.6.1.dev0 (unreleased)
    55=======================
     6
     7* Add `ApplicantEmailSource` (not used and tested in base package).
    68
    79* Redirect to payment ticket page after ticket creation.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r16243 r16275  
    6767directlyProvides(contextual_reg_num_source, IContextSourceBinder)
    6868
     69class EmailInSource(ValidationError):
     70    """An application record with email address exists.
     71    """
     72    # The docstring of ValidationErrors is used as error description
     73    # by zope.formlib.
     74    pass
     75
     76class ApplicantEmailSource(RegNumberSource):
     77    """A source that accepts any email address if not used already by a
     78    different applicant. This source is not used in the base package.
     79    """
     80    cat_name = 'applicants_catalog'
     81    field_name = 'email'
     82    validation_error = EmailInSource
     83    comp_field = 'applicant_id'
     84
     85def contextual_email_source(context):
     86    source = ApplicantEmailSource(context)
     87    return source
     88directlyProvides(contextual_email_source, IContextSourceBinder)
    6989
    7090class AppCatCertificateSource(CertificateSource):
Note: See TracChangeset for help on using the changeset viewer.