本文整理汇总了Python中account.models.AccountDeletion类的典型用法代码示例。如果您正苦于以下问题:Python AccountDeletion类的具体用法?Python AccountDeletion怎么用?Python AccountDeletion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AccountDeletion类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
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
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)
示例3: expunge_deleted
def expunge_deleted():
return AccountDeletion.expunge()
示例4: handle
def handle(self, *args, **options):
count = AccountDeletion.expunge()
print("{0} expunged.".format(count))
示例5: handle
def handle(self, *args, **options):
count = AccountDeletion.expunge()
print "%d expunged." % count