markup: do xls generation on webdav pdf save
This commit is contained in:
@ -22,6 +22,8 @@ from django.conf import settings
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'procat2.settings')
|
||||
django.setup()
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from .utils import clean_path, ensure_dir, set_file_perms, WORKDIR
|
||||
from .email import reply, reply_missing, reply_no_matches, send_error_email
|
||||
from .matching import find_marked_products
|
||||
@ -90,11 +92,13 @@ def process_attachment(from_address, subject, attachment):
|
||||
|
||||
|
||||
@shared_task(on_failure=on_fail_handler)
|
||||
def process_markup_pdf(pdf_path, user):
|
||||
def process_markup_pdf(pdf_path, username):
|
||||
if not Path(pdf_path).is_file():
|
||||
print(f'No pdf - exiting ({pdf_path})')
|
||||
return
|
||||
|
||||
user = User.objects.get(username=username)
|
||||
|
||||
pdf_stem = Path(pdf_path).stem
|
||||
workdir = os.path.join(WORKDIR, clean_path(user.username), clean_path(pdf_stem))
|
||||
ensure_dir(workdir)
|
||||
|
||||
Reference in New Issue
Block a user