fix: the designer's extra hours come from the order's own record
designer_hours ignored the hours stored with the order's treatment; an order keeps the hours it was sold with, 48/24 only when none are recorded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,11 +59,11 @@ def redesign_price(items, choice, offer):
|
|||||||
def designer_hours(snapshot):
|
def designer_hours(snapshot):
|
||||||
"""The extra hours the paid designer work adds to the deadline: 48 h when
|
"""The extra hours the paid designer work adds to the deadline: 48 h when
|
||||||
any art was sent to Redesenho, else 24 h for the basic Ajuste Fino."""
|
any art was sent to Redesenho, else 24 h for the basic Ajuste Fino."""
|
||||||
if snapshot.get('redesign'):
|
# The hours recorded with the order win (an order keeps what it was sold
|
||||||
return 48
|
# with); 48 and 24 are the defaults for snapshots that carry none.
|
||||||
if snapshot.get('treatment'):
|
hours = [int((snapshot[key] if isinstance(snapshot.get(key), dict) else {}).get('hours') or default)
|
||||||
return 24
|
for key, default in (('redesign', 48), ('treatment', 24)) if snapshot.get(key)]
|
||||||
return 0
|
return max(hours, default=0)
|
||||||
|
|
||||||
|
|
||||||
def needs_designer(snapshot):
|
def needs_designer(snapshot):
|
||||||
|
|||||||
Reference in New Issue
Block a user