예제 #1
0
파일: forms.py 프로젝트: anvileight/salest
 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)
예제 #2
0
파일: models.py 프로젝트: anvileight/salest
 def set_hash_key(self):
     """ This method generate and set hash key based on """
     self.hash_key = get_secure_key(self.email)
     return True