Ignore:
Timestamp:
27 Nov 2011, 06:50:43 (13 years ago)
Author:
Henrik Bettermann
Message:

Now we have a configuration object and can provide ContactAdminForm? with proper credentials for a smtp server.

Add Email address to IAccount objects so that 'From' fields in emails, sent by users, can be automatically filled.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/authentication.py

    r7190 r7221  
    5252
    5353    @property
     54    def email(self):
     55        return self.context.email
     56
     57    @property
    5458    def description(self):
    5559        return self.title
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r7214 r7221  
    1616## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    1717##
    18 import re
    1918from datetime import datetime
    2019from zope.interface import Attribute, invariant, Interface
    2120from zope.interface.exceptions import Invalid
    2221from zope import schema
    23 from waeup.sirp.interfaces import IWAeUPObject, academic_sessions_vocab
     22from waeup.sirp.interfaces import (
     23    IWAeUPObject, academic_sessions_vocab, validate_email)
    2424from waeup.sirp.schema import TextLineChoice
    2525from waeup.sirp.university.vocabularies import CourseSource, study_modes
     
    3030from waeup.sirp.payments.interfaces import IPaymentsContainer, IOnlinePayment
    3131
    32 # Define a valiation method for email addresses
    33 class NotAnEmailAddress(schema.ValidationError):
    34     __doc__ = u"Invalid email address"
    35 
    36 check_email = re.compile(
    37     r"[a-zA-Z0-9._%-]+@([a-zA-Z0-9-]+.)*[a-zA-Z]{2,4}").match
    38 def validate_email(value):
    39     if not check_email(value):
    40         raise NotAnEmailAddress(value)
    41     return True
    42 
    4332class IStudentsUtils(Interface):
    4433    """A collection of methods which are subject to customization.
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py

    r7193 r7221  
    6363    fullname = 'Test User'
    6464    password = None
     65    email = None
    6566
    6667
Note: See TracChangeset for help on using the changeset viewer.