delete_users: only project models; Django admin history (LogEntry.user_id is staff) was being counted

Account deletion also keeps the status log of the payment records it keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 06:20:05 +03:30
parent 63cd1af6f7
commit 2f1e257533
3 changed files with 28 additions and 2 deletions

View File

@@ -424,7 +424,7 @@ def _upgradable_guest(request, phone: str):
DELETE_CONFIRM_WORD = 'حذف'
# سوابقِ پرداخت سندِ مالی‌اند و با حذفِ حساب نمی‌روند (تراکنش‌ها با سفارش می‌مانند).
KEPT_ON_ACCOUNT_DELETE = ('payment.Order',)
KEPT_ON_ACCOUNT_DELETE = ('payment.Order', 'statuslog.StatusChangeLog')
class DeleteAccountView(APIView):