Changeset 6121 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 16 May 2011, 17:23:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py
r6119 r6121 24 24 """ 25 25 import grok 26 from hurry.query import Eq 27 from hurry.query.interfaces import IQuery 28 from zope.component import getUtility 26 29 from waeup.sirp.interfaces import IWAeUPSIRPPluggable 27 30 from waeup.sirp.accesscodes import get_access_code … … 97 100 ``APP`` or ``PUDE``, ``XXX`` the access code series and 98 101 ``YYYYYYYYYY`` the real accesscode number. 102 103 This function requires a fully blown setup as it does catalog 104 lookups for finding applicants. 99 105 """ 100 site = grok.getSite() 101 for container in site['applicants'].values(): 102 applicant_data = container.get(identifier, None) 103 if applicant_data is not None: 104 return applicant_data 105 return None 106 query = getUtility(IQuery) 107 results = list(query.searchResults( 108 Eq(('applicants_catalog', 'access_code'), identifier) 109 )) 110 if len(results) == 0: 111 return None 112 return results[0] 106 113 107 114 def application_exists(identifier):
Note: See TracChangeset for help on using the changeset viewer.