Skip to content

Commit aa5e708

Browse files
committed
chore: remove unused code
1 parent 46655e2 commit aa5e708

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

wlhosted/payments/models.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
#
1919

20-
import os.path
2120
import uuid
2221

2322
import requests
@@ -28,7 +27,6 @@
2827
from django.core.exceptions import ValidationError
2928
from django.core.serializers.json import DjangoJSONEncoder
3029
from django.db import models, transaction
31-
from django.utils.functional import cached_property
3230
from django.utils.translation import get_language, gettext_lazy, pgettext_lazy
3331
from django_countries.fields import CountryField
3432
from vies.models import VATINField
@@ -257,34 +255,6 @@ class Meta:
257255
def __str__(self):
258256
return f"payment:{self.pk}"
259257

260-
@cached_property
261-
def is_legacy(self):
262-
return self.invoice.startswith("P") or len(self.invoice) == 6
263-
264-
@cached_property
265-
def invoice_filename(self):
266-
if self.is_legacy:
267-
return f"{self.invoice}.pdf"
268-
return f"Weblate_Invoice_{self.invoice}.pdf"
269-
270-
@cached_property
271-
def invoice_full_filename(self):
272-
if self.is_legacy:
273-
subdir = ("proforma" if self.state == self.PENDING else "pdf",)
274-
invoice_path = settings.PAYMENT_FAKTURACE_LECACY / subdir
275-
else:
276-
invoice_path = (
277-
settings.PAYMENT_FAKTURACE
278-
/ f"{self.created.year}"
279-
/ f"{self.created.month:02d}"
280-
)
281-
full_path = invoice_path / self.invoice_filename
282-
return full_path.as_posix()
283-
284-
@cached_property
285-
def invoice_filename_valid(self):
286-
return os.path.exists(self.invoice_full_filename)
287-
288258
@property
289259
def vat_amount(self):
290260
if self.customer.needs_vat and not self.amount_fixed:

0 commit comments

Comments
 (0)