Changeset 7221 for main/waeup.sirp/trunk/src/waeup/sirp/students
- Timestamp:
- 27 Nov 2011, 06:50:43 (13 years ago)
- 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 52 52 53 53 @property 54 def email(self): 55 return self.context.email 56 57 @property 54 58 def description(self): 55 59 return self.title -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r7214 r7221 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 import re19 18 from datetime import datetime 20 19 from zope.interface import Attribute, invariant, Interface 21 20 from zope.interface.exceptions import Invalid 22 21 from zope import schema 23 from waeup.sirp.interfaces import IWAeUPObject, academic_sessions_vocab 22 from waeup.sirp.interfaces import ( 23 IWAeUPObject, academic_sessions_vocab, validate_email) 24 24 from waeup.sirp.schema import TextLineChoice 25 25 from waeup.sirp.university.vocabularies import CourseSource, study_modes … … 30 30 from waeup.sirp.payments.interfaces import IPaymentsContainer, IOnlinePayment 31 31 32 # Define a valiation method for email addresses33 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}").match38 def validate_email(value):39 if not check_email(value):40 raise NotAnEmailAddress(value)41 return True42 43 32 class IStudentsUtils(Interface): 44 33 """A collection of methods which are subject to customization. -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py
r7193 r7221 63 63 fullname = 'Test User' 64 64 password = None 65 email = None 65 66 66 67
Note: See TracChangeset for help on using the changeset viewer.