Skip to content

Commit c2eb339

Browse files
committed
v0.1.16.2 - NewOrderEvent: lot_id, lot_shortcut
1 parent 4aadbea commit c2eb339

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

handlers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ def log_new_order_handler(c: Cardinal, e: NewOrderEvent, *args):
501501
def setup_event_attributes_handler(c: Cardinal, e: NewOrderEvent, *args):
502502
config_section_name = None
503503
config_section_obj = None
504+
lot_shortcut = None
505+
lot_id = None
504506
lot_description = e.order.description
505507
# пробуем найти лот, чтобы не выдавать по строке, которую вписал покупатель при оформлении заказа
506508
for lot in sorted(list(c.profile.get_sorted_lots(2).get(e.order.subcategory, {}).values()),
@@ -514,6 +516,8 @@ def setup_event_attributes_handler(c: Cardinal, e: NewOrderEvent, *args):
514516

515517
if temp_desc in e.order.description:
516518
lot_description = temp_desc
519+
lot_shortcut = lot
520+
lot_id = lot.id
517521
break
518522

519523
for i in range(3):
@@ -534,7 +538,7 @@ def setup_event_attributes_handler(c: Cardinal, e: NewOrderEvent, *args):
534538

535539
attributes = {"config_section_name": config_section_name, "config_section_obj": config_section_obj,
536540
"delivered": False, "delivery_text": None, "goods_delivered": 0, "goods_left": None,
537-
"error": 0, "error_text": None}
541+
"error": 0, "error_text": None, "lot_id": lot_id, "lot_shortcut": lot_shortcut}
538542
for i in attributes:
539543
setattr(e, i, attributes[i])
540544

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
......................','.",`............ ..................
5757
............................................................"""
5858

59-
VERSION = "0.1.16.1"
59+
VERSION = "0.1.16.2"
6060

6161
Utils.cardinal_tools.set_console_title(f"FunPay Cardinal v{VERSION}")
6262

0 commit comments

Comments
 (0)