# Path: userprofiles/settings.py
# class Settings(object):
#     def __init__(self, **kwargs):
#     def __getattr__(self, key):
# def validate_settings():


from datetime import timedelta
from django.conf import settings
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
from userprofiles.settings import up_settings
import hashlib
import random
import re
import uuid
                verification = self.get(activation_key=activation_key)
            except self.model.DoesNotExist:
                return False

            if not verification.activation_key_expired():
                user = verification.user
                user.is_active = True
                user.save()

                verification.activation_key = self.model.ACTIVATED
                verification.save()

                return user

        return False

    def create_inactive_user(self, username, password, email):
        new_user = User.objects.create_user(username, email, password)
        new_user.is_active = False
        new_user.save()

        account_verification = self.create_verification(new_user)
        current_site = Site.objects.get_current()

        subject = ''.join(render_to_string(
            'userprofiles/mails/activation_email_subject.html',
            {'site': current_site}).splitlines())

        message = render_to_string('userprofiles/mails/activation_email.html', {
            'activation_key': account_verification.activation_key,

# Path: userprofiles/settings.py
# class Settings(object):
#     def __init__(self, **kwargs):
#     def __getattr__(self, key):
# def validate_settings():


# Path: userprofiles/contrib/accountverification/models.py
from datetime import timedelta
from django.conf import settings
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.db import models
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
from userprofiles.settings import up_settings
import hashlib
import random
import re
import uuid

                verification = self.get(activation_key=activation_key)
            except self.model.DoesNotExist:
                return False

            if not verification.activation_key_expired():
                user = verification.user
                user.is_active = True
                user.save()

                verification.activation_key = self.model.ACTIVATED
                verification.save()

                return user

        return False

    def create_inactive_user(self, username, password, email):
        new_user = User.objects.create_user(username, email, password)
        new_user.is_active = False
        new_user.save()

        account_verification = self.create_verification(new_user)
        current_site = Site.objects.get_current()

        subject = ''.join(render_to_string(
            'userprofiles/mails/activation_email_subject.html',
            {'site': current_site}).splitlines())

        message = render_to_string('userprofiles/mails/activation_email.html', {
            'activation_key': account_verification.activation_key,

            'expiration_days': up_settings.ACCOUNT_VERIFICATION_DAYS,