Allow resetting choice packs

This commit is contained in:
Cal Corum 2023-10-24 18:32:15 -05:00
parent 92ba5129a1
commit 3fa7e47880

View File

@ -218,11 +218,20 @@ async def patch_pack(
if pack_type_id is not None: if pack_type_id is not None:
this_pack.pack_type_id = pack_type_id this_pack.pack_type_id = pack_type_id
if pack_team_id is not None: if pack_team_id is not None:
this_pack.pack_team_id = pack_team_id if pack_team_id < 0:
this_pack.pack_team_id = None
else:
this_pack.pack_team_id = pack_team_id
if pack_cardset_id is not None: if pack_cardset_id is not None:
this_pack.pack_cardset_id = pack_cardset_id if pack_cardset_id < 0:
this_pack.pack_cardset_id = None
else:
this_pack.pack_cardset_id = pack_cardset_id
if open_time is not None: if open_time is not None:
this_pack.open_time = open_time if open_time < 0:
this_pack.open_time = None
else:
this_pack.open_time = open_time
if this_pack.save() == 1: if this_pack.save() == 1:
return_val = model_to_dict(this_pack) return_val = model_to_dict(this_pack)