Changeset 6706 for main/waeup.sirp


Ignore:
Timestamp:
10 Sep 2011, 00:23:39 (13 years ago)
Author:
uli
Message:

Check matching of entered passwords via invariant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/interfaces.py

    r6705 r6706  
    11##
    22## interfaces.py
    3 from zope.interface import Interface, Attribute
     3from zope.interface import Interface, Attribute, invariant
     4from zope.interface.exceptions import Invalid
    45from zope import schema
    56from waeup.sirp.interfaces import IWAeUPObject
     
    7475        required = False,
    7576        )
     77
     78    @invariant
     79    def passwords_match(obj):
     80        if obj.password == obj.password_repeat:
     81            return
     82        raise Invalid('passwords do not match')
    7683
    7784class IStudentBase(IWAeUPObject):
Note: See TracChangeset for help on using the changeset viewer.