reformat
This commit is contained in:
parent
1bd01f9652
commit
b09e1b556b
7 changed files with 7 additions and 30 deletions
|
@ -21,3 +21,4 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix, --exit-non-zero-on-fix]
|
args: [--fix, --exit-non-zero-on-fix]
|
||||||
|
- id: ruff-format
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
"""
|
|
||||||
ASGI config for facturio project.
|
|
||||||
|
|
||||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
|
||||||
|
|
||||||
For more information on this file, see
|
|
||||||
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
|
|
||||||
"""
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.core.asgi import get_asgi_application
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
|
@ -1,14 +1,3 @@
|
||||||
"""
|
|
||||||
Django settings for facturio project.
|
|
||||||
|
|
||||||
Generated by 'django-admin startproject' using Django 5.0.
|
|
||||||
|
|
||||||
For more information on this file, see
|
|
||||||
https://docs.djangoproject.com/en/5.0/topics/settings/
|
|
||||||
|
|
||||||
For the full list of settings and their values, see
|
|
||||||
https://docs.djangoproject.com/en/5.0/ref/settings/
|
|
||||||
"""
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
"""
|
|
||||||
WSGI config for facturio project.
|
|
||||||
|
|
||||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
|
||||||
|
|
||||||
For more information on this file, see
|
|
||||||
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
|
|
||||||
"""
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
|
@ -90,7 +90,10 @@ class InvoiceFile(models.Model):
|
||||||
|
|
||||||
invoice = models.ForeignKey(Invoice, on_delete=models.CASCADE, related_name='files')
|
invoice = models.ForeignKey(Invoice, on_delete=models.CASCADE, related_name='files')
|
||||||
file = models.FileField(
|
file = models.FileField(
|
||||||
_('File'), upload_to='invoice-files/%Y/%m/%d/', null=True, blank=True,
|
_('File'),
|
||||||
|
upload_to='invoice-files/%Y/%m/%d/',
|
||||||
|
null=True,
|
||||||
|
blank=True,
|
||||||
)
|
)
|
||||||
created_date = models.DateTimeField(_('Created Date'), auto_now=True)
|
created_date = models.DateTimeField(_('Created Date'), auto_now=True)
|
||||||
|
|
||||||
|
|
|
@ -18,5 +18,6 @@ def generate_pdf(invoice_id: int):
|
||||||
with client.chromium.url_to_pdf() as task:
|
with client.chromium.url_to_pdf() as task:
|
||||||
res = task.url(print_url).run()
|
res = task.url(print_url).run()
|
||||||
invoice_file.file.save(
|
invoice_file.file.save(
|
||||||
invoice_file.get_file_name('pdf'), ContentFile(res.content),
|
invoice_file.get_file_name('pdf'),
|
||||||
|
ContentFile(res.content),
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""Django's command-line utility for administrative tasks."""
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
Reference in a new issue