Exemple #1
0
def add_changelog_created(event):
    """Add created message to the transaction_changelog."""
    if IPasswordReset.providedBy(event.object):
        return  # don't tell others about created password resets
    _add_changelog(event.registry, event.object, key='created', value=True)
    parent = event.object.__parent__
    if parent is not None:
        _add_changelog(event.registry, parent, key='modified', value=True)
def add_changelog_created(event):
    """Add created message to the transaction_changelog."""
    if IPasswordReset.providedBy(event.object):
        return  # don't tell others about created password resets
    _add_changelog(event.registry, event.object, key='created', value=True)
    parent = event.object.__parent__
    if parent is not None:
        _add_changelog(event.registry, parent, key='modified', value=True)
Exemple #3
0
def _raise_if_outdated(node: SchemaNode, value: IPasswordReset,
                       creation_date: datetime):
        if (now() - creation_date).days >= 7:
            value.__parent__ = None  # commit_suicide
            msg = 'This password reset is older than 7 days.'
            raise colander.Invalid(node, msg)
Exemple #4
0
def _raise_if_no_password_reset(node: SchemaNode, value: IPasswordReset):
    if not IPasswordReset.providedBy(value):
        raise colander.Invalid(node, 'This is not a valid password reset.')
Exemple #5
0
def _raise_if_outdated(node: SchemaNode, value: IPasswordReset,
                       creation_date: datetime):
    if (now() - creation_date).days >= 7:
        value.__parent__ = None  # commit_suicide
        msg = 'This password reset is older than 7 days.'
        raise Invalid(node, msg)
Exemple #6
0
def _raise_if_no_password_reset(node: SchemaNode, value: IPasswordReset):
    if not IPasswordReset.providedBy(value):
        raise Invalid(node, 'This is not a valid password reset.')