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/')
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)
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)
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/')