Ignore:
Timestamp:
28 Nov 2011, 10:35:47 (13 years ago)
Author:
Henrik Bettermann
Message:

Implement contact form to send messages to students.

helpers.py: Let get_user_account look for the right IAuthenticatorPlugin (works well with students and users but not with applicants).
applicants/authentication.py: Add getAccount method which returns None at the moment (to let the tests pass).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py

    r7225 r7229  
    2727from cStringIO import StringIO
    2828from docutils.core import publish_string
    29 from zope.component import getUtility
     29from zope.component import getUtility, getUtilitiesFor
    3030from zope.component.interfaces import IFactory
    3131from zope.interface import implementedBy
     
    477477    """
    478478    principal_id = request.principal.id
    479     authenticator = getUtility(IAuthenticatorPlugin, name='users')
    480     account = authenticator.getAccount(principal_id)
     479    authenticators = getUtilitiesFor(IAuthenticatorPlugin)
     480    for authenticator in authenticators:
     481        account = authenticator[1].getAccount(principal_id)
     482        if account:
     483            break
    481484    return account
    482485
Note: See TracChangeset for help on using the changeset viewer.