diff --git a/core/controllers/ConfigurationController.py b/core/controllers/ConfigurationController.py index 5ed9ed3..dcd17d3 100644 --- a/core/controllers/ConfigurationController.py +++ b/core/controllers/ConfigurationController.py @@ -57,6 +57,12 @@ class ConfigurationController: configuration.connection = connection configuration.save() + @staticmethod + def set_connection_enum(connection_enum: ConnectionChoice) -> bool: + configuration = ConfigurationController.get_or_new() + configuration.connection = connection_enum + configuration.save() + @staticmethod def get_auto_sync_enabled(): diff --git a/core/controllers/ProfileController.py b/core/controllers/ProfileController.py index f99699b..b6f6321 100644 --- a/core/controllers/ProfileController.py +++ b/core/controllers/ProfileController.py @@ -344,3 +344,13 @@ class ProfileController: @staticmethod def has_wireguard_configuration(profile: Union[SessionProfile, SystemProfile]): return profile.has_wireguard_configuration() + + @staticmethod + def turn_on_assassin(profile: SessionProfile): + profile.assassin = True + profile.save() + + @staticmethod + def turn_off_assassin(profile: SessionProfile): + profile.assassin = False + profile.save() diff --git a/core/controllers/tickets/UseTicketController.py b/core/controllers/tickets/UseTicketController.py index c55676b..07ef5c6 100644 --- a/core/controllers/tickets/UseTicketController.py +++ b/core/controllers/tickets/UseTicketController.py @@ -169,14 +169,16 @@ def use_ticket( ticket_observer.notify("connecting", "Connecting..") reply_object = use_ticket_orchestrator(which_ticket, which_location, connection_observer) - # TRANSLATE FOR UI - if reply_object.valid: - return {"valid": True, "billing_code": reply_object.data} + return reply_object - error_msg = reply_object.message - error_type = reply_object.error_type - logger.error(f"Error Type: {error_type}") - return {"valid": False, "message": error_msg, "error_type": error_type} + # TRANSLATE FOR UI + # if reply_object.valid: + # return {"valid": True, "billing_code": reply_object.data} + + # error_msg = reply_object.message + # error_type = reply_object.error_type + # logger.error(f"Error Type: {error_type}") + # return {"valid": False, "message": error_msg, "error_type": error_type} def pick_a_random_ticket(ticket_observer: TicketObserver) -> dict: diff --git a/core/services/using_tickets/use_ticket_orchestrator.py b/core/services/using_tickets/use_ticket_orchestrator.py index b44ac10..5c3406f 100644 --- a/core/services/using_tickets/use_ticket_orchestrator.py +++ b/core/services/using_tickets/use_ticket_orchestrator.py @@ -106,7 +106,7 @@ def use_ticket_orchestrator( ) if not saved: logger.error(f"Failed to save {which_ticket} is expired! That's okay the data is worthless to save.") - return Result(valid=False, error_type=ResultError.SUBSCRIPTION, message=f"This ticket {which_ticket}'s subscription is expired.") + return Result(valid=False, error_type=ResultError.SUBSCRIPTION, message=f"This ticket {which_ticket}'s subscription is expired. Do you want to wipe it?") # UNKNOWN return Result(valid=False, error_type=ResultError.UNKNOWN, message=f"Unknown error with this data: {raw_data_dict}. {CUSTOMER_SERVICE_MSG}")