Use new media server for invoices
This commit is contained in:
parent
ef3e3ad03e
commit
08b3c3dd18
3 changed files with 5 additions and 3 deletions
|
@ -93,7 +93,7 @@ class TransactionForm(ModelForm):
|
|||
|
||||
|
||||
def invoice_path(instance, filename):
|
||||
return pathlib.Path("invoices", str(instance.id), filename)
|
||||
return pathlib.Path("invoices", str(instance.id)).with_suffix(".pdf")
|
||||
|
||||
|
||||
class Invoice(models.Model):
|
||||
|
|
|
@ -15,9 +15,11 @@
|
|||
<div class="transaction {% cycle 'w' 'g' %}">
|
||||
<span class="attach center">
|
||||
{% for invoice in trans.invoices %}
|
||||
<a href="{% url "invoice" invoice.id %}">
|
||||
{% spaceless %}
|
||||
<a href="{{ invoice.file.url }}">
|
||||
<i class="fa fa-paperclip"></i>
|
||||
</a>
|
||||
{% endspaceless %}
|
||||
{% endfor %}
|
||||
</span>
|
||||
<span class="date num center">{{ trans.date|date:"Y-m-d" }}</span>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div id="invoices">
|
||||
{% for inv in transaction.invoices %}
|
||||
<div class="invoice">
|
||||
<a href="{% url 'invoice' inv.id %}">{{ inv.name }}</a>
|
||||
<a href="{{ inv.file.url }}">{{ inv.name }}</a>
|
||||
<a href="{% url 'del_invoice' transaction.id inv.id %}"
|
||||
onclick="return confirm('{% translate "Delete" %} <{{ inv.name }}> ?')">
|
||||
<i class="fa-regular fa-trash-can"></i>
|
||||
|
|
Loading…
Reference in a new issue