当前位置: 首页>>代码示例>>Python>>正文


Python GsuserManager.get_useremail_by_id方法代码示例

本文整理汇总了Python中gitshell.gsuser.models.GsuserManager.get_useremail_by_id方法的典型用法代码示例。如果您正苦于以下问题:Python GsuserManager.get_useremail_by_id方法的具体用法?Python GsuserManager.get_useremail_by_id怎么用?Python GsuserManager.get_useremail_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gitshell.gsuser.models.GsuserManager的用法示例。


在下文中一共展示了GsuserManager.get_useremail_by_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: email_verified

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import get_useremail_by_id [as 别名]
def email_verified(request, token):
    useremail_id = cache.get(token + '_useremail_id')
    usermail = GsuserManager.get_useremail_by_id(useremail_id)
    if usermail and usermail.is_verify == 0 and usermail.user_id == request.user.id:
        usermail.is_verify = 1
        usermail.save()
    return HttpResponseRedirect('/settings/emails/')
开发者ID:ZheYuan,项目名称:gitshell,代码行数:9,代码来源:views.py

示例2: email_verify

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import get_useremail_by_id [as 别名]
def email_verify(request, eid):
    usermail = GsuserManager.get_useremail_by_id(eid)
    email = usermail.email
    via = ''
    if usermail and usermail.is_verify == 0 and usermail.user_id == request.user.id:
        Mailer().send_verify_email(request.user, eid, email)
        email_suffix = email.split('@')[-1]
        if email_suffix in COMMON_EMAIL_DOMAIN:
            via = COMMON_EMAIL_DOMAIN[email_suffix]
        return json_httpResponse({'code': 200, 'message': u'请尽快验证邮箱', 'via': via})
    return json_httpResponse({'code': 500, 'message': u'邮箱不对,或者没有相关权限', 'via': via})
开发者ID:ZheYuan,项目名称:gitshell,代码行数:13,代码来源:views.py

示例3: email_primary

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import get_useremail_by_id [as 别名]
def email_primary(request, eid):
    usermail = GsuserManager.get_useremail_by_id(eid)
    if not usermail or usermail.user_id != request.user.id:
        return json_failed(500, u'设置失败,没有权限')
    useremails = GsuserManager.list_useremail_by_userId(request.user.id)
    for x in useremails:
        if usermail.id != x.id and x.is_primary == 1:
            x.is_primary = 0
            x.save()
    usermail.is_primary = 1
    usermail.save()
    return json_success(u'成功设置默认邮箱 %s' % usermail.email)
开发者ID:ZheYuan,项目名称:gitshell,代码行数:14,代码来源:views.py

示例4: email_remove

# 需要导入模块: from gitshell.gsuser.models import GsuserManager [as 别名]
# 或者: from gitshell.gsuser.models.GsuserManager import get_useremail_by_id [as 别名]
def email_remove(request, eid):
    usermail = GsuserManager.get_useremail_by_id(eid)
    if usermail and usermail.user_id == request.user.id:
        usermail.visibly = 1
        usermail.save()
    return json_success(u'成功删除邮箱 %s' % usermail.email)
开发者ID:ZheYuan,项目名称:gitshell,代码行数:8,代码来源:views.py


注:本文中的gitshell.gsuser.models.GsuserManager.get_useremail_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。