本文整理汇总了Python中hc.api.models.Channel.email_verified方法的典型用法代码示例。如果您正苦于以下问题:Python Channel.email_verified方法的具体用法?Python Channel.email_verified怎么用?Python Channel.email_verified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hc.api.models.Channel
的用法示例。
在下文中一共展示了Channel.email_verified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _make_user
# 需要导入模块: from hc.api.models import Channel [as 别名]
# 或者: from hc.api.models.Channel import email_verified [as 别名]
def _make_user(email):
username = str(uuid.uuid4())[:30]
user = User(username=username, email=email)
user.save()
channel = Channel()
channel.user = user
channel.kind = "email"
channel.value = email
channel.email_verified = True
channel.save()
return user
示例2: handle
# 需要导入模块: from hc.api.models import Channel [as 别名]
# 或者: from hc.api.models.Channel import email_verified [as 别名]
def handle(self, *args, **options):
for user in User.objects.all():
q = Channel.objects.filter(user=user)
q = q.filter(kind="email", email_verified=True, value=user.email)
if q.count() > 0:
continue
print("Creating default channel for %s" % user.email)
channel = Channel(user=user)
channel.kind = "email"
channel.value = user.email
channel.email_verified = True
channel.save()
channel.checks.add(*Check.objects.filter(user=user))
示例3: _make_user
# 需要导入模块: from hc.api.models import Channel [as 别名]
# 或者: from hc.api.models.Channel import email_verified [as 别名]
def _make_user(email):
username = str(uuid.uuid4())[:30]
user = User(username=username, email=email)
user.set_unusable_password()
user.save()
profile = Profile(user=user)
profile.save()
channel = Channel()
channel.user = user
channel.kind = "email"
channel.value = email
channel.email_verified = True
channel.save()
return user
示例4: _make_user
# 需要导入模块: from hc.api.models import Channel [as 别名]
# 或者: from hc.api.models.Channel import email_verified [as 别名]
def _make_user(email):
username = str(uuid.uuid4())[:30]
user = User(username=username, email=email)
user.set_unusable_password()
user.save()
# Ensure a profile gets created
Profile.objects.for_user(user)
channel = Channel()
channel.user = user
channel.kind = "email"
channel.value = email
channel.email_verified = True
channel.save()
return user