本文整理匯總了Python中dao.UserDao.delete_user方法的典型用法代碼示例。如果您正苦於以下問題:Python UserDao.delete_user方法的具體用法?Python UserDao.delete_user怎麽用?Python UserDao.delete_user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dao.UserDao
的用法示例。
在下文中一共展示了UserDao.delete_user方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete_user
# 需要導入模塊: from dao import UserDao [as 別名]
# 或者: from dao.UserDao import delete_user [as 別名]
def delete_user(username):
user = UserDao.get_user(username)
if user and authentication.allow_full_user_changes(username):
UserDao.delete_user(username)
user = UserDao.get_user(username)
if not user:
assignees = assigneesHandler.get_customers(username)
for assignee in assignees:
assigneesHandler.delete(assignee.get('user'), assignee.get('customer'))
assignees = assigneesHandler.get_customers('username')
if not assignees or len(assignees) == 0:
return True
return False