本文整理汇总了Python中core.models.UserProfile.user_creation方法的典型用法代码示例。如果您正苦于以下问题:Python UserProfile.user_creation方法的具体用法?Python UserProfile.user_creation怎么用?Python UserProfile.user_creation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.models.UserProfile
的用法示例。
在下文中一共展示了UserProfile.user_creation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_user_account
# 需要导入模块: from core.models import UserProfile [as 别名]
# 或者: from core.models.UserProfile import user_creation [as 别名]
def setup_user_account(strategy, backend, request, details, *args, **kwargs):
username = details['username'].replace(' ', '')
user = User.objects.get(username=username)
# New user supplied email and is new
if kwargs['is_new'] and details['email']:
UserProfile.user_creation(user)
welcome_new_user_fb_notification(details['username'], details['email'])
elif not details['email']:
if user.email is '' and not request.get('email', None):
return HttpResponseRedirect('/request_email')
elif user.email is '' and request.get('email', None):
user.email = request['email']
user.save()
UserProfile.user_creation(user)
welcome_new_user_fb_notification(details['username'], request['email'])
return {'email': request['email']}
return
示例2: send_welcome_email
# 需要导入模块: from core.models import UserProfile [as 别名]
# 或者: from core.models.UserProfile import user_creation [as 别名]
def send_welcome_email(sender, **kwargs):
user = kwargs['user']
UserProfile.user_creation(user)
welcome_new_user_notification(user)