# Path: IESPV/settings.py
# EMAIL_HOST_USER = ''
# 
# Path: core/models.py
# class Observer(object):
#     
#     def update(self, input):
#         return        
# 
# class Observable(object):
#     
#     def add_observers():
#         return
# 
#     
#     def remove_observers(self, input):
#         return
# 
#     
#     def notify_observers(self, input):
#         pass        
# 
# class Email(object):
# 	
# 	def send_email(self, subject, message, email_destination):
# 		send_mail(
#                subject,
#                message,
#                EMAIL_HOST_USER,
#                [email_destination],
#                fail_silently=False,
#         )


from django.db import models
from django.contrib.auth.models import AbstractUser, User
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import send_mail
from IESPV.settings import EMAIL_HOST_USER
from datetime import datetime
from six import with_metaclass
from core.models import Observer, Observable, Email 
import hashlib
    observers_in_secretary = []

    def listAllSecretaries(self):
        secretaries = Secretary.objects.all()
        return secretaries

    def add_observers(self):
        self.observers_in_secretary = Administrator.objects.all()
        
    def remove_observers(self, input):
        return

    def notify_observers(self, input):
        for observer in self.observers_in_secretary:
            observer.update(input)


    def date_time_release(self):
        date_now = datetime.now()

        if self.release_activate_at.date() == date_now.date():
           if self.release_activate_at.hour - date_now.hour >= 6:
                self.add_observers()
                self.notify_observers(self.user.email) 

        else:
            self.add_observers()
            self.notify_observers(self.user.email)
        


# Path: IESPV/settings.py
# EMAIL_HOST_USER = ''
# 
# Path: core/models.py
# class Observer(object):
#     
#     def update(self, input):
#         return        
# 
# class Observable(object):
#     
#     def add_observers():
#         return
# 
#     
#     def remove_observers(self, input):
#         return
# 
#     
#     def notify_observers(self, input):
#         pass        
# 
# class Email(object):
# 	
# 	def send_email(self, subject, message, email_destination):
# 		send_mail(
#                subject,
#                message,
#                EMAIL_HOST_USER,
#                [email_destination],
#                fail_silently=False,
#         )


# Path: users/models.py
from django.db import models
from django.contrib.auth.models import AbstractUser, User
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import send_mail
from IESPV.settings import EMAIL_HOST_USER
from datetime import datetime
from six import with_metaclass
from core.models import Observer, Observable, Email 
import hashlib

    observers_in_secretary = []

    def listAllSecretaries(self):
        secretaries = Secretary.objects.all()
        return secretaries

    def add_observers(self):
        self.observers_in_secretary = Administrator.objects.all()
        
    def remove_observers(self, input):
        return

    def notify_observers(self, input):
        for observer in self.observers_in_secretary:
            observer.update(input)


    def date_time_release(self):
        date_now = datetime.now()

        if self.release_activate_at.date() == date_now.date():
           if self.release_activate_at.hour - date_now.hour >= 6:
                self.add_observers()
                self.notify_observers(self.user.email) 

        else:
            self.add_observers()
            self.notify_observers(self.user.email)
        


class RecoveryPassword(models.Model):