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


Python UserProfile.email_needs_login_key方法代码示例

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


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

示例1: clean_email

# 需要导入模块: from evap.evaluation.models import UserProfile [as 别名]
# 或者: from evap.evaluation.models.UserProfile import email_needs_login_key [as 别名]
    def clean_email(self):
        email = self.cleaned_data.get('email')

        if not UserProfile.email_needs_login_key(email):
            raise forms.ValidationError(_("HPI users cannot request login keys. Please login using your domain credentials."))

        try:
            user = UserProfile.objects.get(email__iexact=email)
            self.user_cache = user
        except UserProfile.DoesNotExist:
            raise forms.ValidationError(_("No user with this email address was found. Please make sure to enter the email address already known to the university office."))

        return email
开发者ID:anukat2015,项目名称:EvaP,代码行数:15,代码来源:forms.py

示例2: clean_email

# 需要导入模块: from evap.evaluation.models import UserProfile [as 别名]
# 或者: from evap.evaluation.models.UserProfile import email_needs_login_key [as 别名]
    def clean_email(self):
        email = self.cleaned_data.get('email')

        if not UserProfile.email_needs_login_key(email):
            raise forms.ValidationError(_("HPI users cannot request login keys. Please login using your domain credentials."))

        try:
            user = UserProfile.objects.get(email__iexact=email)
            self.user_cache = user
        except UserProfile.DoesNotExist:
            raise forms.ValidationError(_("No user with this email address was found. Please make sure to enter the email address used for course or event registration."))

        if not user.is_active:
            raise forms.ValidationError(_("Inactive users cannot request login keys."))

        return email
开发者ID:PFischbeck,项目名称:EvaP,代码行数:18,代码来源:forms.py


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