Ignore:
Timestamp:
9 Oct 2020, 09:00:55 (4 years ago)
Author:
Henrik Bettermann
Message:

Email addresses must be unique in IUO.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/browser.py

    r16220 r16276  
    5555    ICustomPGApplicantEdit, ICustomUGApplicantEdit,
    5656    ICustomApplicantOnlinePayment, ICustomApplicantRefereeReport,
    57     ITranscriptApplicant
     57    ITranscriptApplicant, ICustomApplicantRegisterUpdate
    5858    )
    5959from kofacustom.iuokada.interfaces import MessageFactory as _
     
    369369        return form_fields
    370370
     371class CustomApplicantRegistrationPage(ApplicantRegistrationPage):
     372    """Captcha'd registration page for applicants.
     373    """
     374    @property
     375    def form_fields(self):
     376        form_fields = None
     377        if self.context.mode == 'update':
     378            form_fields = grok.AutoFields(ICustomApplicantRegisterUpdate).select(
     379                'lastname','reg_number','email')
     380        else: #if self.context.mode == 'create':
     381            form_fields = grok.AutoFields(ICustomUGApplicant).select(
     382                'firstname', 'middlename', 'lastname', 'email', 'phone')
     383        return form_fields
     384
    371385class RefereeReportAddFormPage(RefereeReportAddFormPage):
    372386    """Add-form to add an referee report. This form
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/interfaces.py

    r16165 r16276  
    3636    nats_vocab, GenderSource, StudyLevelSource)
    3737from waeup.kofa.applicants.interfaces import (
    38     contextual_reg_num_source, IApplicantBaseData, IApplicantRefereeReport)
     38    contextual_reg_num_source, IApplicantBaseData, IApplicantRefereeReport,
     39    contextual_email_source, IApplicantRegisterUpdate)
    3940from waeup.kofa.refereeentries import RefereeEntryField
    4041from kofacustom.nigeria.applicants.interfaces import (
     
    144145    """
    145146
     147    email = TextLineChoice(
     148        title = _(u'Email Address Test'),
     149        required = False,
     150        constraint=validate_email,
     151        source = contextual_email_source,
     152        )
     153
    146154    subtype = schema.Choice(
    147155        title = _(u'Application Subtype'),
     
    379387    adding them to the PG_OMIT* tuples.
    380388    """
     389
     390    email = TextLineChoice(
     391        title = _(u'Email Address Test'),
     392        required = False,
     393        constraint=validate_email,
     394        source = contextual_email_source,
     395        )
    381396
    382397    sponsor = schema.Choice(
     
    603618        required = True,
    604619        )
    605     email = schema.ASCIILine(
    606         title = _(u'Email Address'),
    607         required = True,
     620    email = TextLineChoice(
     621        title = _(u'Email Address Test'),
     622        required = False,
    608623        constraint=validate_email,
     624        source = contextual_email_source,
    609625        )
    610626    date_of_birth = FormattedDate(
     
    638654        required = True,
    639655        )
    640     email = schema.ASCIILine(
    641         title = _(u'Email Address'),
    642         required = True,
     656    email = TextLineChoice(
     657        title = _(u'Email Address Test'),
     658        required = False,
    643659        constraint=validate_email,
     660        source = contextual_email_source,
    644661        )
    645662    date_of_birth = FormattedDate(
     
    656673    'phone'].order =  ICustomPGApplicantEdit['email'].order
    657674
     675class ICustomApplicantRegisterUpdate(IApplicantRegisterUpdate):
     676    """This is a representation of an applicant for first-time registration.
     677    This interface is used when applicants use the registration page to
     678    update their records.
     679    """
     680
     681    email = TextLineChoice(
     682        title = _(u'Email Address Test'),
     683        required = False,
     684        constraint=validate_email,
     685        source = contextual_email_source,
     686        )
     687
    658688class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
    659689    """An applicant payment via payment gateways.
Note: See TracChangeset for help on using the changeset viewer.