More email SKU shenanigans, now with more TEST labels!

This commit is contained in:
2026-09-14 11:41:27 -05:00
parent a6f60408ff
commit b5570d39f0
12 changed files with 815 additions and 139 deletions
+8 -2
View File
@@ -7,6 +7,8 @@ for the label-creation side of this.
"""
from __future__ import annotations
from typing import Optional
from app import config
from app.status_rules import parse_status_list
@@ -17,6 +19,10 @@ def get_emailed_label_skus() -> set[str]:
)
def is_emailed_label_order(skus: list[str]) -> bool:
emailed_skus = get_emailed_label_skus()
def is_emailed_label_order(skus: list[str], emailed_skus: Optional[set] = None) -> bool:
"""emailed_skus can be pre-fetched and passed in when checking many
orders at once (e.g. refreshing the table), to avoid re-reading
Settings from disk for every single order."""
if emailed_skus is None:
emailed_skus = get_emailed_label_skus()
return any((sku or "").strip().lower() in emailed_skus for sku in skus or [])