• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python ccnet_threaded_rpc.get_emailuser函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中seaserv.ccnet_threaded_rpc.get_emailuser函数的典型用法代码示例。如果您正苦于以下问题:Python get_emailuser函数的具体用法?Python get_emailuser怎么用?Python get_emailuser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: clean_email

 def clean_email(self):
     email = self.cleaned_data['email']
     emailuser = ccnet_threaded_rpc.get_emailuser(email)
     if not emailuser:
         return self.cleaned_data['email']
     else:
         raise forms.ValidationError(_("A user with this email already"))
开发者ID:chuyskywalker,项目名称:seahub,代码行数:7,代码来源:accounts.py


示例2: get

    def get(self, email=None, id=None):
        if not email and not id:
            raise User.DoesNotExist, 'User matching query does not exits.'
            
        if email:
            emailuser = ccnet_threaded_rpc.get_emailuser(email)
        if id:
            emailuser = ccnet_threaded_rpc.get_emailuser_by_id(id)
        if not emailuser:
            raise User.DoesNotExist, 'User matching query does not exits.'
    
        user = User(emailuser.email)
        user.id = emailuser.id
        user.is_staff = emailuser.is_staff
        user.is_active = emailuser.is_active
        user.ctime = emailuser.ctime
        user.org = emailuser.org

        # User last login timestamp is recorded in a seperated table.
        from seahub.base.models import UserLastLogin
        try:
            user_last_login = UserLastLogin.objects.get(username=emailuser.email)
            login_dt = user_last_login.last_login
        except UserLastLogin.DoesNotExist:
            from seahub.utils.time import dt
            login_dt = dt(user.ctime)
        user.last_login = login_dt

        return user
开发者ID:gleez,项目名称:seahub,代码行数:29,代码来源:accounts.py


示例3: save

 def save(self):
     emailuser = ccnet_threaded_rpc.get_emailuser(self.username)
     if emailuser:
         if not hasattr(self, "password"):
             self.set_unusable_password()
         ccnet_threaded_rpc.update_emailuser(emailuser.id, self.password, int(self.is_staff), int(self.is_active))
     else:
         ccnet_threaded_rpc.add_emailuser(self.username, self.password, int(self.is_staff), int(self.is_active))
开发者ID:viktorlindgren,项目名称:seahub,代码行数:8,代码来源:accounts.py


示例4: save

 def save(self):
     emailuser = ccnet_threaded_rpc.get_emailuser(self.username)
     if emailuser:
         ccnet_threaded_rpc.update_emailuser(emailuser.id, self.password,
                                             int(self.is_staff),
                                             int(self.is_active))
     else:
         ccnet_threaded_rpc.add_emailuser(self.username, self.password,
                                          int(self.is_staff),
                                          int(self.is_active))
开发者ID:chuyskywalker,项目名称:seahub,代码行数:10,代码来源:accounts.py


示例5: clean_email

    def clean_email(self):
        email = self.cleaned_data['email']
        if not self.allow_register(email):
            raise forms.ValidationError(_("Enter a valid email address."))

        emailuser = ccnet_threaded_rpc.get_emailuser(email)
        if not emailuser:
            return self.cleaned_data['email']
        else:
            raise forms.ValidationError(_("User %s already exists.") % email)
开发者ID:pinguo-liuhongwei,项目名称:seahub,代码行数:10,代码来源:accounts.py


示例6: clean_email

    def clean_email(self):
        email = self.cleaned_data['email']
        if not is_valid_username(email):
            raise forms.ValidationError(_("Enter a valid email address."))

        emailuser = ccnet_threaded_rpc.get_emailuser(email)
        if not emailuser:
            return self.cleaned_data['email']
        else:
            raise forms.ValidationError(_("A user with this email already"))
开发者ID:penyatree,项目名称:seahub,代码行数:10,代码来源:accounts.py


示例7: get

    def get(self, email=None, id=None):
        if not email and not id:
            raise User.DoesNotExist, "User matching query does not exits."

        if email:
            emailuser = ccnet_threaded_rpc.get_emailuser(email)
        if id:
            emailuser = ccnet_threaded_rpc.get_emailuser_by_id(id)
        if not emailuser:
            raise User.DoesNotExist, "User matching query does not exits."

        user = User(emailuser.email)
        user.id = emailuser.id
        user.is_staff = emailuser.is_staff
        user.is_active = emailuser.is_active
        user.ctime = emailuser.ctime
        user.org = emailuser.org
        return user
开发者ID:viktorlindgren,项目名称:seahub,代码行数:18,代码来源:accounts.py


示例8: save

    def save(self):
        emailuser = ccnet_threaded_rpc.get_emailuser(self.username)
        if emailuser:
            if not hasattr(self, 'password'):
                self.set_unusable_password()

            if emailuser.source == "DB":
                source = "DB"
            else:
                source = "LDAP"

            ccnet_threaded_rpc.update_emailuser(source,
                                                emailuser.id,
                                                self.password,
                                                int(self.is_staff),
                                                int(self.is_active))
        else:
            ccnet_threaded_rpc.add_emailuser(self.username, self.password,
                                             int(self.is_staff),
                                             int(self.is_active))
开发者ID:penyatree,项目名称:seahub,代码行数:20,代码来源:accounts.py


示例9: get

    def get(self, email=None, id=None):
        if not email and not id:
            raise User.DoesNotExist, 'User matching query does not exits.'

        if email:
            emailuser = ccnet_threaded_rpc.get_emailuser(email)
        if id:
            emailuser = ccnet_threaded_rpc.get_emailuser_by_id(id)
        if not emailuser:
            raise User.DoesNotExist, 'User matching query does not exits.'

        user = User(emailuser.email)
        user.id = emailuser.id
        user.enc_password = emailuser.password
        user.is_staff = emailuser.is_staff
        user.is_active = emailuser.is_active
        user.ctime = emailuser.ctime
        user.org = emailuser.org
        user.source = emailuser.source
        user.role = emailuser.role

        return user
开发者ID:pinguo-liuhongwei,项目名称:seahub,代码行数:22,代码来源:accounts.py


示例10: save

    def save(self):
        emailuser = ccnet_threaded_rpc.get_emailuser(self.username)
        if emailuser:
            if not hasattr(self, 'password'):
                self.set_unusable_password()

            if emailuser.source == "DB":
                source = "DB"
            else:
                source = "LDAP"

            result_code = ccnet_threaded_rpc.update_emailuser(source,
                                                              emailuser.id,
                                                              self.password,
                                                              int(self.is_staff),
                                                              int(self.is_active))
        else:
            result_code = ccnet_threaded_rpc.add_emailuser(self.username,
                                                           self.password,
                                                           int(self.is_staff),
                                                           int(self.is_active))
        # -1 stands for failed; 0 stands for success
        return result_code
开发者ID:pinguo-liuhongwei,项目名称:seahub,代码行数:23,代码来源:accounts.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python seafile_api.check_permission_by_path函数代码示例发布时间:2022-05-27
下一篇:
Python ccnet_api.get_group函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap