Ejemplo n.º 1
0
 def __get_or_create(user):
     if AuthServicesInfo.objects.filter(user=user).exists():
         return AuthServicesInfo.objects.get(user=user)
     else:
         # We have to create
         print 'here'
         authserviceinfo = AuthServicesInfo()
         authserviceinfo.user = user
         authserviceinfo.save()
         return authserviceinfo
Ejemplo n.º 2
0
 def __get_or_create(user):
     if AuthServicesInfo.objects.filter(user=user).exists():
         return AuthServicesInfo.objects.get(user=user)
     else:
         # We have to create
         print 'here'
         authserviceinfo = AuthServicesInfo()
         authserviceinfo.user = user
         authserviceinfo.save()
         return authserviceinfo
Ejemplo n.º 3
0
 def __get_or_create(user):
     if AuthServicesInfo.objects.filter(user=user).exists():
         logger.debug("Returning existing authservicesinfo model for user %s" % user)
         return AuthServicesInfo.objects.get(user=user)
     else:
         # We have to create
         logger.info("Creating new authservicesinfo model for user %s" % user)
         authserviceinfo = AuthServicesInfo()
         authserviceinfo.user = user
         authserviceinfo.save()
         return authserviceinfo
Ejemplo n.º 4
0
 def __get_or_create(user):
     if AuthServicesInfo.objects.filter(user=user).exists():
         logger.debug(
             "Returning existing authservicesinfo model for user %s" % user)
         return AuthServicesInfo.objects.get(user=user)
     else:
         # We have to create
         logger.info("Creating new authservicesinfo model for user %s" %
                     user)
         authserviceinfo = AuthServicesInfo()
         authserviceinfo.user = user
         authserviceinfo.save()
         return authserviceinfo