# Path: util/html_clean.py
# def clean_for_user_description(html):
#     """
#     Removes dangerous tags, including h1.
#     """
#     return bleach.clean(html, tags=USER_DESCR_ALLOWED_TAGS, strip=True)


from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from markdown import markdown
from django.views.decorators.debug import sensitive_variables
from util.html_clean import clean_for_user_description
            email=email,
            username=username,
            password=password,
            first_name=first_name,
            last_name=last_name
        )
        user.is_active = False
        user.save()

        return UserInformation.objects.create(user=user, accepted_privacy_policy=True)


ACTIVATION_TYPES = {
    'email': 'e'
}


class Activation(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    token = models.CharField(max_length=50)
    type = models.CharField(max_length=1,
                            choices=tuple((v, k)
                                          for k, v in ACTIVATION_TYPES.items())
                            )


def get_user_information(obj):
    if isinstance(obj, User):
        return obj.userinformation
    elif isinstance(obj, UserInformation):

# Path: util/html_clean.py
# def clean_for_user_description(html):
#     """
#     Removes dangerous tags, including h1.
#     """
#     return bleach.clean(html, tags=USER_DESCR_ALLOWED_TAGS, strip=True)


# Path: user/models.py
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from markdown import markdown
from django.views.decorators.debug import sensitive_variables
from util.html_clean import clean_for_user_description

            email=email,
            username=username,
            password=password,
            first_name=first_name,
            last_name=last_name
        )
        user.is_active = False
        user.save()

        return UserInformation.objects.create(user=user, accepted_privacy_policy=True)


ACTIVATION_TYPES = {
    'email': 'e'
}


class Activation(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    token = models.CharField(max_length=50)
    type = models.CharField(max_length=1,
                            choices=tuple((v, k)
                                          for k, v in ACTIVATION_TYPES.items())
                            )


def get_user_information(obj):
    if isinstance(obj, User):
        return obj.userinformation
    elif isinstance(obj, UserInformation):

        return obj