# Path: lazysignup/constants.py
# USER_AGENT_BLACKLIST = []
# 
# Path: lazysignup/exceptions.py
# class NotLazyError(TypeError):
#     """ Raised when an operation is attempted on a non-lazy user """
# 
# Path: lazysignup/utils.py
# def is_lazy_user(user):
#     """ Return True if the passed user is a lazy user. """
#     # Anonymous users are not lazy.
# 
#     if user.is_anonymous:
#         return False
# 
#     # Check the user backend. If the lazy signup backend
#     # authenticated them, then the user is lazy.
#     backend = getattr(user, 'backend', None)
#     if backend == 'lazysignup.backends.LazySignupBackend':
#         return True
# 
#     # Otherwise, we have to fall back to checking the database.
#     from lazysignup.models import LazyUser
#     return bool(LazyUser.objects.filter(user=user).count() > 0)
# 
# Path: lazysignup/signals.py

# 
# Path: lazysignup/constants.py
# LAZYSIGNUP_USER_MODEL = getattr(settings, 'LAZYSIGNUP_USER_MODEL', settings.AUTH_USER_MODEL)
# LAZYSIGNUP_CUSTOM_USER_CREATION_FORM = getattr(
#     settings,
#     'LAZYSIGNUP_CUSTOM_USER_CREATION_FORM',
#     None
# )
# DEFAULT_BLACKLIST = (
#     'slurp',
#     'googlebot',
#     'yandex',
#     'msnbot',
#     'baiduspider',
# )
# USER_AGENT_BLACKLIST = []


import re
import uuid
import six
from django.conf import settings
from django.db import models
from django.utils.timezone import now
from lazysignup.constants import USER_AGENT_BLACKLIST
from lazysignup.exceptions import NotLazyError
from lazysignup.utils import is_lazy_user
from lazysignup.signals import converted
from lazysignup import constants
from django.contrib.auth import get_user_model


DEFAULT_BLACKLIST = (
    'slurp',
    'googlebot',
    'yandex',
    'msnbot',
    'baiduspider',
)

for user_agent in getattr(settings, 'LAZYSIGNUP_USER_AGENT_BLACKLIST', DEFAULT_BLACKLIST):
    USER_AGENT_BLACKLIST.append(re.compile(user_agent, re.I))



# Path: lazysignup/constants.py
# USER_AGENT_BLACKLIST = []
# 
# Path: lazysignup/exceptions.py
# class NotLazyError(TypeError):
#     """ Raised when an operation is attempted on a non-lazy user """
# 
# Path: lazysignup/utils.py
# def is_lazy_user(user):
#     """ Return True if the passed user is a lazy user. """
#     # Anonymous users are not lazy.
# 
#     if user.is_anonymous:
#         return False
# 
#     # Check the user backend. If the lazy signup backend
#     # authenticated them, then the user is lazy.
#     backend = getattr(user, 'backend', None)
#     if backend == 'lazysignup.backends.LazySignupBackend':
#         return True
# 
#     # Otherwise, we have to fall back to checking the database.
#     from lazysignup.models import LazyUser
#     return bool(LazyUser.objects.filter(user=user).count() > 0)
# 
# Path: lazysignup/signals.py

# 
# Path: lazysignup/constants.py
# LAZYSIGNUP_USER_MODEL = getattr(settings, 'LAZYSIGNUP_USER_MODEL', settings.AUTH_USER_MODEL)
# LAZYSIGNUP_CUSTOM_USER_CREATION_FORM = getattr(
#     settings,
#     'LAZYSIGNUP_CUSTOM_USER_CREATION_FORM',
#     None
# )
# DEFAULT_BLACKLIST = (
#     'slurp',
#     'googlebot',
#     'yandex',
#     'msnbot',
#     'baiduspider',
# )
# USER_AGENT_BLACKLIST = []


# Path: lazysignup/models.py
import re
import uuid
import six
from django.conf import settings
from django.db import models
from django.utils.timezone import now
from lazysignup.constants import USER_AGENT_BLACKLIST
from lazysignup.exceptions import NotLazyError
from lazysignup.utils import is_lazy_user
from lazysignup.signals import converted
from lazysignup import constants
from django.contrib.auth import get_user_model



DEFAULT_BLACKLIST = (
    'slurp',
    'googlebot',
    'yandex',
    'msnbot',
    'baiduspider',
)

for user_agent in getattr(settings, 'LAZYSIGNUP_USER_AGENT_BLACKLIST', DEFAULT_BLACKLIST):
    USER_AGENT_BLACKLIST.append(re.compile(user_agent, re.I))



class LazyUserManager(models.Manager):