Closed vlad-ed-git closed 1 year ago
When viewing or sending an invoice I get the following assertion error: AssertionError: assert invoice_path.exists()
AssertionError: assert invoice_path.exists()
below is the complete logged exception
2023-01-19 15:24:53.602 | ERROR | invoicing.intent:view_invoice:293 - Failed to open the invoice: 2023-01-19 15:24:53.603 | ERROR | invoicing.intent:view_invoice:294 - Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 973, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x10499b1c0> └ <Thread(Thread-87 (<lambda>), started daemon 6149484544)> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() │ └ <function Thread.run at 0x10499aef0> └ <Thread(Thread-87 (<lambda>), started daemon 6149484544)> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {} │ │ │ │ └ <Thread(Thread-87 (<lambda>), started daemon 6149484544)> │ │ │ └ (<flet.control_event.ControlEvent object at 0x1457e9f60>,) │ │ └ <Thread(Thread-87 (<lambda>), started daemon 6149484544)> │ └ <function InvoiceTile.build.<locals>.<lambda> at 0x1458aadd0> └ <Thread(Thread-87 (<lambda>), started daemon 6149484544)> File "/Users/vlad/Desktop/vlad/tuttle/app/invoicing/view.py", line 455, in <lambda> on_click=lambda e: self.on_view_invoice(self.invoice), │ │ │ │ └ Invoice(number='1', date=datetime.date(2023, 1, 19), project_id=1, paid=False, rendered=True, id=1, contract_id=1, sent=False... │ │ │ └ <invoicing.view.InvoiceTile object at 0x145886d40> │ │ └ <bound method InvoicingListView.on_view_invoice of <invoicing.view.InvoicingListView object at 0x144dc4b80>> │ └ <invoicing.view.InvoiceTile object at 0x145886d40> └ <flet.control_event.ControlEvent object at 0x1457e9f60> File "/Users/vlad/Desktop/vlad/tuttle/app/invoicing/view.py", line 210, in on_view_invoice result = self.intent.view_invoice(invoice) │ │ │ └ Invoice(number='1', date=datetime.date(2023, 1, 19), project_id=1, paid=False, rendered=True, id=1, contract_id=1, sent=False... │ │ └ <function InvoicingIntent.view_invoice at 0x130f8ecb0> │ └ <invoicing.intent.InvoicingIntent object at 0x144dc4bb0> └ <invoicing.view.InvoicingListView object at 0x144dc4b80> > File "/Users/vlad/Desktop/vlad/tuttle/app/invoicing/intent.py", line 289, in view_invoice assert pdf_path.exists() │ └ <function Path.exists at 0x105616dd0> └ PosixPath('/Users/vlad/.tuttle/Invoices/1-lima.pdf') AssertionError: assert pdf_path.exists() 2023-01-19 15:24:59.719 | DEBUG | core.abstractions:query:161 - querying <class 'tuttle.model.User'> 2023-01-19 15:24:59.736 | INFO | core.abstractions:query:167 - Found 1 instances of <class 'tuttle.model.User'> 2023-01-19 15:24:59.937 | ERROR | invoicing.intent:send_invoice_by_mail:190 - ❌ Error sending invoice by mail: 2023-01-19 15:24:59.938 | ERROR | invoicing.intent:send_invoice_by_mail:191 - Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 973, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x10499b1c0> └ <Thread(Thread-96 (<lambda>), started daemon 6149484544)> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() │ └ <function Thread.run at 0x10499aef0> └ <Thread(Thread-96 (<lambda>), started daemon 6149484544)> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {} │ │ │ │ └ <Thread(Thread-96 (<lambda>), started daemon 6149484544)> │ │ │ └ (<flet.control_event.ControlEvent object at 0x1458be110>,) │ │ └ <Thread(Thread-96 (<lambda>), started daemon 6149484544)> │ └ <function InvoiceTile.build.<locals>.<lambda> at 0x1458ab1c0> └ <Thread(Thread-96 (<lambda>), started daemon 6149484544)> File "/Users/vlad/Desktop/vlad/tuttle/app/invoicing/view.py", line 460, in <lambda> on_click=lambda e: self.on_mail_invoice(self.invoice), │ │ │ │ └ Invoice(number='1', date=datetime.date(2023, 1, 19), project_id=1, paid=False, rendered=True, id=1, contract_id=1, sent=False... │ │ │ └ <invoicing.view.InvoiceTile object at 0x145886d40> │ │ └ <bound method InvoicingListView.on_mail_invoice of <invoicing.view.InvoicingListView object at 0x144dc4b80>> │ └ <invoicing.view.InvoiceTile object at 0x145886d40> └ <flet.control_event.ControlEvent object at 0x1458be110> File "/Users/vlad/Desktop/vlad/tuttle/app/invoicing/view.py", line 205, in on_mail_invoice result = self.intent.send_invoice_by_mail(invoice) │ │ │ └ Invoice(number='1', date=datetime.date(2023, 1, 19), project_id=1, paid=False, rendered=True, id=1, contract_id=1, sent=False... │ │ └ <function InvoicingIntent.send_invoice_by_mail at 0x130f8e9e0> │ └ <invoicing.intent.InvoicingIntent object at 0x144dc4bb0> └ <invoicing.view.InvoicingListView object at 0x144dc4b80> > File "/Users/vlad/Desktop/vlad/tuttle/app/invoicing/intent.py", line 183, in send_invoice_by_mail assert invoice_path.exists() │ └ <function Path.exists at 0x105616dd0> └ PosixPath('/Users/vlad/.tuttle/Invoices/1-lima.pdf') AssertionError: assert invoice_path.exists()```
Demo invoices do not have a PDF yet, I'll make that a separate ticket because it's not a small change. I improved the error handling in case a PDF does not exist. Is this done?
When viewing or sending an invoice I get the following assertion error:
AssertionError: assert invoice_path.exists()
below is the complete logged exception