Allura/allura/lib/decorators.py
def _make_extra(self, result=None):
        '''Create a dict of extra items to be added to a log record
        '''
        extra = self._extra_proto.copy()
        # Save the client IP address
        extra.update(client_ip=utils.ip_address(request))
        # Save the user info
        user = getattr(request, 'user', None)
        if user:
            extra.update(user=user.username,
                         user_id=user.id)
        # Save the project info
        if (result
                and isinstance(result, dict)
                and 'p' in result
                and result['p'] is not None):
            extra.update(
                source=result['p']['source'],
                project_name=result['p']['shortname'],
                group_id=result['p'].get('sf_id'))
        # Log the referer cookie if it exists
        referer_link = request.cookies.get('referer_link')
        if referer_link:
            referer_link = unquote(referer_link)
            try:
                referer_link = json.loads(referer_link)
            except ValueError:
                pass
        extra['referer_link'] = referer_link
        return extra
Create a dict of extra items to be added to a log record
        
Create a dict of extra items to be added to a log record
Create a dict of extra items to be added to a log record
def _make_extra(self, result=None):
        extra = self._extra_proto.copy()
        extra.update(client_ip=utils.ip_address(request))
        user = getattr(request, 'user', None)
        if user:
            extra.update(user=user.username,
                         user_id=user.id)
        if (result
                and isinstance(result, dict)
                and 'p' in result
                and result['p'] is not None):
            extra.update(
                source=result['p']['source'],
                project_name=result['p']['shortname'],
                group_id=result['p'].get('sf_id'))
        referer_link = request.cookies.get('referer_link')
        if referer_link:
            referer_link = unquote(referer_link)
            try:
                referer_link = json.loads(referer_link)
            except ValueError:
                pass
        extra['referer_link'] = referer_link
        return extra
def _make_extra ( self , result = None ) : extra = self . _extra_proto . copy ( ) extra . update ( client_ip = utils . ip_address ( request ) ) user = getattr ( request , 'user' , None ) if user : extra . update ( user = user . username , user_id = user . id ) if ( result and isinstance ( result , dict ) and 'p' in result and result [ 'p' ] is not None ) : extra . update ( source = result [ 'p' ] [ 'source' ] , project_name = result [ 'p' ] [ 'shortname' ] , group_id = result [ 'p' ] . get ( 'sf_id' ) ) referer_link = request . cookies . get ( 'referer_link' ) if referer_link : referer_link = unquote ( referer_link ) try : referer_link = json . loads ( referer_link ) except ValueError : pass extra [ 'referer_link' ] = referer_link return extra
Create a dict of extra items to be added to a log record
Create a dict of extra items to be added to a log record
'''Create a dict of extra items to be added to a log record
        ''' # Save the client IP address # Save the user info # Save the project info # Log the referer cookie if it exists
self
result