Добавлена проверка на транзакции кошелька при удалении заказа
Удаление заказа теперь блокируется если есть связанные WalletTransaction (on_delete=PROTECT). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
<a href="{% url 'orders:order-update' order.order_number %}" class="btn btn-primary">
|
||||
<i class="bi bi-pencil"></i> Редактировать
|
||||
</a>
|
||||
{% if order.status and order.status.code == 'draft' and order.amount_paid == 0 %}
|
||||
{% if order.status and order.status.code == 'draft' and order.amount_paid == 0 and not order.wallet_transactions.exists %}
|
||||
<a href="{% url 'orders:order-delete' order.order_number %}" class="btn btn-danger">
|
||||
<i class="bi bi-trash"></i> Удалить
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user