def send_email(self): """ This method should send email to just registered User with confirmation link """ key = get_secure_key(self.instance.email) site = Site.objects.get_current() UserConfirmation.objects.create(user=self.instance, key=key) context = {'site': site, 'key': key } kw_params = {'template_key': 'invitation_email', 'context': context, 'emails': [self.instance.email] } EmailTemplate.send(**kw_params)
def set_hash_key(self): """ This method generate and set hash key based on """ self.hash_key = get_secure_key(self.email) return True