Bug fix in order cart line model.
This commit is contained in:
@@ -175,7 +175,7 @@ def load_order_obj(
|
|||||||
inc_person: bool = False,
|
inc_person: bool = False,
|
||||||
inc_user: bool = False,
|
inc_user: bool = False,
|
||||||
):
|
):
|
||||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
if order_id := redis_lookup_id_random(record_id_random=order_id, table_name='order'): pass
|
if order_id := redis_lookup_id_random(record_id_random=order_id, table_name='order'): pass
|
||||||
@@ -216,7 +216,7 @@ def load_order_obj(
|
|||||||
|
|
||||||
# Updated 2021-08-07
|
# Updated 2021-08-07
|
||||||
if inc_order_cfg:
|
if inc_order_cfg:
|
||||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
# log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
if order_cfg_result := load_order_cfg_obj(
|
if order_cfg_result := load_order_cfg_obj(
|
||||||
account_id = order_rec.get('account_id', None),
|
account_id = order_rec.get('account_id', None),
|
||||||
by_alias = by_alias,
|
by_alias = by_alias,
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Order_Cart_Line_Base(BaseModel):
|
|||||||
product_unit_price: Optional[int] # Copied from product record
|
product_unit_price: Optional[int] # Copied from product record
|
||||||
product_recurring: Optional[bool] # Copied from product record
|
product_recurring: Optional[bool] # Copied from product record
|
||||||
|
|
||||||
curr_product_id_random: str # Should be the same as product_id_random above
|
curr_product_id_random: Optional[str] # Should be the same as product_id_random above
|
||||||
curr_product_id: Optional[int] # Should be the same as product_id above
|
curr_product_id: Optional[int] # Should be the same as product_id above
|
||||||
curr_product_for_type: Optional[str] # Dynamic from v_order_current_line
|
curr_product_for_type: Optional[str] # Dynamic from v_order_current_line
|
||||||
curr_product_for_id_random: Optional[str] # Dynamic from v_order_current_line
|
curr_product_for_id_random: Optional[str] # Dynamic from v_order_current_line
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ async def get_order_obj(
|
|||||||
by_alias: bool = True,
|
by_alias: bool = True,
|
||||||
exclude_unset: bool = True,
|
exclude_unset: bool = True,
|
||||||
):
|
):
|
||||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
if order_obj := load_order_obj(
|
if order_obj := load_order_obj(
|
||||||
@@ -184,7 +184,6 @@ async def get_order_obj(
|
|||||||
inc_order_line_list = inc_order_line_list,
|
inc_order_line_list = inc_order_line_list,
|
||||||
inc_order_cfg = inc_order_cfg,
|
inc_order_cfg = inc_order_cfg,
|
||||||
):
|
):
|
||||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
|
||||||
log.debug(order_obj)
|
log.debug(order_obj)
|
||||||
data = order_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
data = order_obj.dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||||
return mk_resp(data=data)
|
return mk_resp(data=data)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ async def post_order_cart_obj(
|
|||||||
# Update 2021-08-02 (partially)
|
# Update 2021-08-02 (partially)
|
||||||
@router.patch('/{order_cart_id}', response_model=Resp_Body_Base)
|
@router.patch('/{order_cart_id}', response_model=Resp_Body_Base)
|
||||||
async def patch_order_cart_obj(
|
async def patch_order_cart_obj(
|
||||||
order_cart_id: str = Query(..., min_length=1, max_length=22),
|
order_cart_id: str = Query(..., min_length=11, max_length=22),
|
||||||
order_cart_obj: Order_Cart_Base = None,
|
order_cart_obj: Order_Cart_Base = None,
|
||||||
repl_order_cart_line_list: Optional[bool] = False, # Replace all the lines instead of trying to update
|
repl_order_cart_line_list: Optional[bool] = False, # Replace all the lines instead of trying to update
|
||||||
# was repl_order_cart_line_list # NOTE: It was with out _list, just _li
|
# was repl_order_cart_line_list # NOTE: It was with out _list, just _li
|
||||||
@@ -57,7 +57,7 @@ async def patch_order_cart_obj(
|
|||||||
by_alias: Optional[bool] = True,
|
by_alias: Optional[bool] = True,
|
||||||
exclude_unset: Optional[bool] = True,
|
exclude_unset: Optional[bool] = True,
|
||||||
):
|
):
|
||||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
log.debug(order_cart_obj)
|
log.debug(order_cart_obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user