Exemple #1
0
    def validate_client_id(form, field):
        if not field.data:
            return

        member = Member.find_by_id(field.data)
        if not member:
            raise ValidationError('Client not found.')
Exemple #2
0
    def validate_member_id(form, field):
        from members.models import Member
        
        if request.method == 'POST':
            if not form.member_id.data:
                raise ValidationError(field.gettext('This field is required.'))

            field.member = Member.find_by_id(field.data)
            if not member:
                raise ValidationError('Member not found.')

        else:
            field.data = None
Exemple #3
0
 def validate_owner_id(form, field):
     if field.data:
         member = Member.find_by_id(field.data)
         if not member:
             raise ValidationError('Member (owner) was not found.')