Ignore:
Timestamp:
15 Feb 2012, 10:51:53 (13 years ago)
Author:
Henrik Bettermann
Message:

Do not retrieve current principal in derived logging components. This is now done by the parent Logger class.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py

    r7438 r7652  
    3333    IExtFileStore, IPDF, IUserAccount)
    3434from waeup.sirp.students.vocabularies import RegNumNotInSource
    35 from waeup.sirp.utils.helpers import attrs_to_fields, get_current_principal
     35from waeup.sirp.utils.helpers import attrs_to_fields
    3636from waeup.sirp.applicants.interfaces import IApplicant, IApplicantEdit
    3737
     
    314314    comment = 'Applicant record removed'
    315315    target = applicant.applicant_id
    316     # In some tests we don't have a principal
    317316    try:
    318         user = get_current_principal().id
    319     except (TypeError, AttributeError):
    320         return
    321     try:
    322         grok.getSite()['applicants'].logger.info('%s - %s - %s' % (
    323             user, target, comment))
     317        grok.getSite()['applicants'].logger.info('%s - %s' % (
     318            target, comment))
    324319    except KeyError:
    325320        # If we delete an entire university instance there won't be
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py

    r7375 r7652  
    2525from waeup.sirp.interfaces import ISIRPPluggable
    2626from waeup.sirp.applicants.interfaces import IApplicantsRoot
    27 from waeup.sirp.utils.helpers import get_current_principal
    2827from waeup.sirp.utils.logger import Logger
    2928
     
    4241        """Get the logger's info method.
    4342        """
    44         user = get_current_principal()
    45         user = getattr(user, 'id', 'system')
    46         self.logger.info('%s - %s - %s - %s' % (
    47                 user, target, ob_class, comment))
     43        self.logger.info('%s - %s - %s' % (
     44                target, ob_class, comment))
    4845        return
    4946
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py

    r7370 r7652  
    2424from waeup.sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo
    2525from waeup.sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo
    26 from waeup.sirp.utils.helpers import get_current_principal
    2726
    2827INITIALIZED = 'initialized'
     
    157156    # In some tests we don't have a an applicants root or a user
    158157    try:
    159         user = get_current_principal()
    160158        applicants_root = grok.getSite()['applicants']
    161         applicants_root.logger.info('%s - %s - %s' % (user.id,obj.applicant_id,msg))
     159        applicants_root.logger.info('%s - %s' % (obj.applicant_id,msg))
    162160    except (TypeError, AttributeError):
    163161        pass
Note: See TracChangeset for help on using the changeset viewer.