markup: special email for no matched products
This commit is contained in:
@ -19,7 +19,7 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'procat2.settings')
|
||||
django.setup()
|
||||
|
||||
from .utils import clean_path, ensure_dir, set_file_perms, WORKDIR
|
||||
from .email import reply, reply_missing
|
||||
from .email import reply, reply_missing, reply_no_matches
|
||||
from .matching import find_marked_products
|
||||
from .spreadsheet import write_spreadsheet
|
||||
|
||||
@ -62,6 +62,11 @@ def process_attachment(from_address, subject, attachment):
|
||||
|
||||
# find matches
|
||||
matches = find_marked_products(pdf_path, workdir, debug=0)
|
||||
if not matches:
|
||||
print('no product matches')
|
||||
reply_no_matches(from_address, subject)
|
||||
return
|
||||
|
||||
print(f'{len(matches)} product matches')
|
||||
|
||||
# write spreadsheet
|
||||
|
||||
Reference in New Issue
Block a user