本文整理汇总了Python中account.models.AccountDeletion.mark方法的典型用法代码示例。如果您正苦于以下问题:Python AccountDeletion.mark方法的具体用法?Python AccountDeletion.mark怎么用?Python AccountDeletion.mark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类account.models.AccountDeletion
的用法示例。
在下文中一共展示了AccountDeletion.mark方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from account.models import AccountDeletion [as 别名]
# 或者: from account.models.AccountDeletion import mark [as 别名]
def post(self, *args, **kwargs):
AccountDeletion.mark(self.request.user)
auth.logout(self.request)
messages.add_message(
self.request,
self.messages["account_deleted"]["level"],
self.messages["account_deleted"]["text"] % {"expunge_hours": settings.ACCOUNT_DELETION_EXPUNGE_HOURS},
)
return redirect(self.get_redirect_url())
示例2: form_valid
# 需要导入模块: from account.models import AccountDeletion [as 别名]
# 或者: from account.models.AccountDeletion import mark [as 别名]
def form_valid(self, formset):
for form in formset:
deactivate = form.cleaned_data["deactivate"]
if deactivate is True:
user = User.objects.get(email=form.cleaned_data["email"])
AccountDeletion.mark(user)
#Allocate an Enlingo Package Member quota to Customer
InvitationStat.add_invites_to_user(self.request.user, +1)
return super(MemberAccountDeactivate,self).form_valid(formset)