Scheduled Postgres backup, restore check, backup warnings in health, payment result logging

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 17:32:06 +03:30
parent a5feee053a
commit 7d81d193bd
11 changed files with 449 additions and 5 deletions

View File

@@ -223,8 +223,11 @@ class ZarinpalCallbackView(APIView):
# یک NOKِ ناشناس آن را «ناموفق» می‌کرد و با دو سفارش ۵۰۰ می‌داد.
if not authority:
raise ValidationError({'Authority': 'لازم است.'})
order = get_object_or_404(Order, gateway_authority=authority, provider='gateway')
order = Order.objects.filter(gateway_authority=authority, provider='gateway').first()
if order is None:
# کال‌بکِ بی‌سفارش: یا Authorityِ جعلی یا سفارشی که از دیتابیس رفته؛ در دیتابیس ردی ندارد.
logger.warning('zarinpal callback: no order for authority=%s status=%s', authority[:64], status_param[:10])
raise Http404
if status_param != 'OK':
new_status, gateway_ref_id = 'failed', ''
else: