示例#1
0
    def generate_account(self, user):
        account = Account(key=tools.generate_key())
        account.save()
        user_profile = UserProfile(
            user=user,
            account=account
        )
        user_profile.save()
        send_mail(
            'Rmd.io account confirmation',
            """
            Hello,

            please click this link to activate your rmd.io account:
            {0}/registration_done/{1}

            Sincerely,
            The rmd.io Team
            """.format(
              settings.SITE_URL,
              str(account.key, 'utf-8')
            ),
            settings.EMAIL_HOST_USER,
            [user.email],
            fail_silently=False,
        )
示例#2
0
文件: views.py 项目: JohnL17/rmd.io
    def generate_account(self, user):
        account = Account(key=tools.generate_key())
        account.save()
        user_profile = UserProfile(user=user, account=account)
        user_profile.save()
        send_mail(
            'Rmd.io account confirmation',
            """
            Hello,

            please click this link to activate your rmd.io account:
            http://rmd.io/registration_done/{}

            Sincerely,
            The rmd.io Team
            """.format(account.key),
            '*****@*****.**',
            [user.email],
            fail_silently=False,
        )
示例#3
0
def test_type_of_key_generator_output():
    key = tools.generate_key()
    assert type(key) is str