from . import models
from django.conf import settings

import logging
logger = logging.getLogger(__name__)

def get_user_profile(user_id, global_id):
    function ='def get_user_profile'
    logger.info(function)
    logger.info('%s - user_id:%s, global_id:%s' % (function, user_id,global_id))

    try:
        shortname = getattr(settings, 'POLLSTER_USER_PROFILE_SURVEY', 'intake')
        logger.info('%s - shortname:%s' % (function, shortname))

        survey = models.Survey.get_by_shortname(shortname)

        profile = survey.get_last_participation_data(user_id, global_id)

        return profile
    except models.Survey.DoesNotExist:
        logger.info('%s - Survey.DoesNotExit' % function)
        return None
    except StandardError, e:
        return None

@@ -94,17 +94,30 @@
 ger(
-__name__)
+'logview.userlogins') 
 %0A%0Ade
@@ -142,27 +142,16 @@
 (user_id
-, global_id
 ):%0A    f
@@ -244,22 +244,8 @@
 d:%25s
-, global_id:%25s
 ' %25 
@@ -266,18 +266,9 @@
 r_id
-,global_id
+ 
 ))%0A%0A
@@ -421,17 +421,16 @@
 tname))%0A
-%0A
         
@@ -480,17 +480,16 @@
 rtname)%0A
-%0A
         
@@ -544,21 +544,9 @@
 r_id
-, global_id)%0A
+)
 %0A   
@@ -565,16 +565,17 @@
 profile%0A
+%0A
     exce
@@ -683,16 +683,17 @@
 rn None%0A
+%0A
     exce

Add log functions