Changeset 7175 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 23 Nov 2011, 07:19:16 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r7172 r7175 3 3 import grok 4 4 5 from zope.component import getMultiAdapter, queryAdapter , getUtility5 from zope.component import getMultiAdapter, queryAdapter 6 6 from zope.interface import Interface 7 7 from zope.location.interfaces import ISite 8 8 from zope.traversing.browser import absoluteURL 9 from zope.pluggableauth.interfaces import IAuthenticatorPlugin10 9 from waeup.sirp.browser.pages import ( 11 10 UniversityPage, FacultyContainerPage, DatacenterPage, FacultyPage, … … 17 16 IWAeUPXMLImporter, IDataCenter) 18 17 from waeup.sirp.browser.layout import WAeUPPage 18 from waeup.sirp.utils.helpers import get_user_account 19 19 20 20 grok.templatedir('templates') … … 339 339 icon = '' 340 340 341 def getUserAccount(self):342 """Return local user account.343 """344 principal_id = self.request.principal.id345 authenticator = getUtility(IAuthenticatorPlugin, name='users')346 account = authenticator.getAccount(principal_id)347 return account348 349 341 @property 350 342 def url(self): 351 account_object = self.getUserAccount()343 account_object = get_user_account(self.request) 352 344 if account_object: 353 return absoluteURL(account_object, self.request)345 return self.view.url(account_object) 354 346 return 355 347
Note: See TracChangeset for help on using the changeset viewer.