Skip to content

Commit

Permalink
Do not ALLOW_THE_SAME_OPERATION_IN_CART_MULTIPLE_TIMES for OperationS…
Browse files Browse the repository at this point in the history
…ummary by default
  • Loading branch information
mzebrak committed Mar 14, 2024
1 parent 9a18905 commit 0b1cf52
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
class CancelTransferFromSavings(OperationSummary):
BIG_TITLE: ClassVar[str] = "Cancel transfer"

ALLOW_THE_SAME_OPERATION_IN_CART_MULTIPLE_TIMES: ClassVar[bool] = False

def __init__(self, transfer: SavingsWithdrawals) -> None:
super().__init__()
self._transfer = transfer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class OperationSummary(OperationBaseScreen, OperationActionBindings, AbstractCla

BIG_TITLE: ClassVar[str] = "Operation summary"

ALLOW_THE_SAME_OPERATION_IN_CART_MULTIPLE_TIMES = False

def create_left_panel(self) -> ComposeResult:
yield BigTitle(self.BIG_TITLE)
with ScrollableContainer(), Body():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from clive.exceptions import RequestIdError
from clive.models import Asset
from schemas.operations import (
CancelTransferFromSavingsOperation,
TransferFromSavingsOperation,
TransferToSavingsOperation,
)
Expand Down Expand Up @@ -132,12 +131,6 @@ def __realized_on(self) -> str:

@on(Button.Pressed, "#delete-transfer-button")
def move_to_cancel_transfer(self) -> None:
if (
CancelTransferFromSavingsOperation(from_=self.__transfer.from_, request_id=self.__transfer.request_id)
in self.app.world.profile_data.cart
):
self.notify("The operation is already in the cart!", severity="error")
return
self.app.push_screen(CancelTransferFromSavings(self.__transfer))


Expand Down

0 comments on commit 0b1cf52

Please sign in to comment.