Skip to content

Commit

Permalink
Invoice not found error msg for user (#382)
Browse files Browse the repository at this point in the history
* Reformated by djLint

* Added Invoice Not Found error msg for user
  • Loading branch information
Domejko authored May 31, 2024
1 parent 9a4ce3f commit 6ecd63e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion backend/api/invoices/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def delete_invoice(request: HtmxHttpRequest):
try:
invoice = Invoice.objects.get(id=delete_items.get("invoice", ""))
except Invoice.DoesNotExist:
return JsonResponse({"message": "Invoice not found"}, status=404)
messages.error(request, "Invoice Not Found")
return render(request, "base/toasts.html")

if not invoice.has_access(request.user):
return JsonResponse({"message": "You do not have permission to delete this invoice"}, status=404)
Expand Down
8 changes: 3 additions & 5 deletions docs/overrides/partials/integrations/analytics/custom.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% if config.extra.analytics.property %}
<!-- <script defer src="{{ config.extra.analytics.property }}" data-website-id="{{ config.extra.analytics.id }}"> -->
<!-- </script> -->
<!-- <script defer src="{{ config.extra.analytics.property }}" data-website-id="{{ config.extra.analytics.id }}"> -->
<!-- </script> -->
{{ config.extra.analytics.property | safe }}
{% else %}
<script>
console.log("failed to load analytics... no property")
</script>
<script>console.log("failed to load analytics... no property")</script>
{% endif %}

0 comments on commit 6ecd63e

Please sign in to comment.