Пример #1
0
    def process_view(self, request, view_func, *view_args, **view_kwargs):
        log_msg = '%s %s' % (request.method, request.path)

        if not getattr(view_func, 'not_record', False):
            req = RequestStore()
            req.path = request.path
            req.method = request.method

            if request.user.is_authenticated():
                req.user = request.user

            req.save()
            logger.info(log_msg + ' was saved')
        else:
            logger.info(log_msg + ' wasn\'t saved')

        return None
Пример #2
0
    def process_view(self, request, view_func, *view_args, **view_kwargs):
        log_msg = '%s %s' % (request.method, request.path)

        if not (view_func.func_name == 'request_ajax'):
            req = RequestStore()
            req.path = request.path
            req.method = request.method

            if request.user.is_authenticated():
                req.user = request.user

            req.save()
            logger.info(log_msg + ' was saved')
        else:
            logger.info(log_msg + ' wasn\'t saved')

        return None
Пример #3
0
    def process_view(self, request, view_func, *view_args, **view_kwargs):
        log_msg = '%s %s' % (request.method, request.path)

        if not getattr(view_func, 'not_record', False):
            req = RequestStore()
            req.path = request.path
            req.method = request.method

            existent_reg = RequestStore.objects\
                                       .filter(path=request.path).first()
            if existent_reg is not None:
                req.priority = existent_reg.priority

            if request.user.is_authenticated():
                req.user = request.user

            req.save()
            logger.info(log_msg + ' was saved')
        else:
            logger.info(log_msg + ' wasn\'t saved')

        return None