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


Python Assurance.listByUser方法代码示例

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


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

示例1: updateHashAndAssurances

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def updateHashAndAssurances(self, user, digest):
     user.hash = digest
     assurances = Assurance.listByUser(user)
     self.deleteHandAssuredAssurances(assurances)
     if digest is not None:
         Assurance.new(user, "hashgiven", user)
     user.save()
开发者ID:Claymanus,项目名称:PDOauth,代码行数:9,代码来源:Controller.py

示例2: computeAssurancesForApp

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def computeAssurancesForApp(self, user, app):
     appAssurances = AppAssurance.get(app)
     userAssurances = Assurance.listByUser(user)
     shownAssurances = list()
     for userAssurance in userAssurances:
         if userAssurance.name in appAssurances:
             shownAssurances.append(userAssurance.name)
     return shownAssurances
开发者ID:Claymanus,项目名称:PDOauth,代码行数:10,代码来源:Controller.py

示例3: do_update_hash

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def do_update_hash(self,form):
     digest = form.digest.data
     if digest == '':
         digest = None
     user = self.getCurrentUser()
     user.hash = digest
     user.save()
     assurances = Assurance.listByUser(user)
     self.deleteHandAssuredAssurances(assurances)
     return self.simple_response('new hash registered')
开发者ID:Sinnach0,项目名称:PDOauth,代码行数:12,代码来源:Controller.py

示例4: updateEmailByCredential

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def updateEmailByCredential(self, cred, verify):
     oldemail=cred.user.email
     cred.user.email = cred.getAdditionalInfo()
     cred.user.save()
     for assurance in Assurance.listByUser(cred.user, 'emailverification'):
         assurance.rm()
     if verify:
         Assurance.new(cred.user, 'emailverification', cred.user)
     else:
         self.sendPasswordVerificationEmail(cred.user)
     self.sendEmail(cred.user, None, None, "CHANGE_EMAIL_DONE",oldemail=oldemail, newemail=cred.user.email)
开发者ID:Claymanus,项目名称:PDOauth,代码行数:13,代码来源:EmailHandling.py

示例5: do_deregister

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def do_deregister(self,form):
     if not self.isLoginCredentials(form):
         raise ReportedError(["You should use your login credentials to deregister"], 400)
     cred = Credential.get(form.credentialType.data, form.identifier.data)
     user = cred.user
     creds = Credential.getByUser(user)
     for cred in creds:
         cred.rm()
     assurances = Assurance.listByUser(user)
     for assurance in assurances:
         assurance.rm()
     user.rm()
     return self.simple_response('deregistered')
开发者ID:Sinnach0,项目名称:PDOauth,代码行数:15,代码来源:Controller.py

示例6: test_adding_assurance_is_possible_using_the_hash_only

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def test_adding_assurance_is_possible_using_the_hash_only(self):
     form = self.prepareLoginForm(email = False)
     self.controller.doAddAssurance(form)
     self.assertEqual(Assurance.listByUser(self.targetUser)[0].name, 'test')
开发者ID:Claymanus,项目名称:PDOauth,代码行数:6,代码来源:AssuranceTest.py

示例7: test_assurers_with_appropriate_credential_can_add_assurance_to_user_using_hash

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def test_assurers_with_appropriate_credential_can_add_assurance_to_user_using_hash(self):
     form = self.prepareLoginForm()
     self.controller.doAddAssurance(form)
     self.assertEqual(Assurance.listByUser(self.targetUser)[0].name, 'test')
开发者ID:Claymanus,项目名称:PDOauth,代码行数:6,代码来源:AssuranceTest.py

示例8: test_confirmChangeEmail_deletes_emailverification_assurance

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def test_confirmChangeEmail_deletes_emailverification_assurance(self):
     self.doConfirmChangeEmail()
     self.assertEqual(list(),Assurance.listByUser(self.user,'emailverification'))
开发者ID:Claymanus,项目名称:PDOauth,代码行数:5,代码来源:EmailChangeTest.py

示例9: removeAssurances

# 需要导入模块: from pdoauth.models.Assurance import Assurance [as 别名]
# 或者: from pdoauth.models.Assurance.Assurance import listByUser [as 别名]
 def removeAssurances(self, user):
     assurances = Assurance.listByUser(user)
     for assurance in assurances:
         assurance.rm()
开发者ID:Claymanus,项目名称:PDOauth,代码行数:6,代码来源:Controller.py


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