from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.

# class AdvUser(AbstractUser):
#     is_activated = models.BooleanField(default=True, db_index=True, verbose_name='Прошел активацию!')
#     send_messages = models.BooleanField(default=True, db_index=True,
#                                         verbose_name='Слать оповещения о новых комментариях')
#     class Meta(AbstractUser.Meta):
#         pass

# from django.db import models

# Create your models here.

# from django.contrib.auth.models import AbstractUser

# Create your models here.
class AdvUser(AbstractUser):
    is_activated = models.BooleanField(default=True, db_index=True, verbose_name='Прошел активацию?')
    send_messages = models.BooleanField(default=True,verbose_name='Слать оповещения о новых комментариях?')


    class Meta(AbstractUser.Meta):
        pass

from django.dispatch import Signal
from .utilities import send_activation_notification
# from .utilities import send_new_comment_notification

user_registrated = Signal(providing_args=['instance'])
def user_registrated_dispatcher(sender, **kwargs):
    send_activation_notification(kwargs['instance'])
user_registrated.connect(user_registrated_dispatcher)