本文整理汇总了Python中gitshell.gsuser.models.GsuserManager.add_useremail方法的典型用法代码示例。如果您正苦于以下问题:Python GsuserManager.add_useremail方法的具体用法?Python GsuserManager.add_useremail怎么用?Python GsuserManager.add_useremail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gitshell.gsuser.models.GsuserManager
的用法示例。
在下文中一共展示了GsuserManager.add_useremail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: bind
# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import add_useremail [as 别名]
def bind(request, ref_hash):
userViaRef = None
if ref_hash:
userViaRef = GsuserManager.get_userViaRef_by_refhash(ref_hash)
GsuserManager.handle_user_via_refhash(request.user, ref_hash)
if userViaRef:
is_verify = 1
if userViaRef.ref_type == REF_TYPE.VIA_REPO_MEMBER:
GsuserManager.add_useremail(request.user, userViaRef.email, is_verify)
return HttpResponseRedirect('/%s/%s/' % (userViaRef.first_refname, userViaRef.second_refname))
elif userViaRef.ref_type == REF_TYPE.VIA_TEAM_MEMBER:
GsuserManager.add_useremail(request.user, userViaRef.email, is_verify)
return HttpResponseRedirect('/%s/' % (userViaRef.first_refname))
return HttpResponseRedirect('/dashboard/')
示例2: email_add
# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import add_useremail [as 别名]
def email_add(request):
is_verify = 0
email = request.POST.get('email')
userEmail = GsuserManager.add_useremail(request.user, email, is_verify)
if not userEmail:
return json_failed(500, u'绑定邮箱个数最多50个,确定邮箱格式正确和未被绑定')
return json_success(u'成功添加邮箱 %s' % email)