From: Jeremy Stanley Date: Wed, 25 Dec 2019 22:23:08 +0000 (+0000) Subject: Relocate delete_account menu function X-Git-Tag: 0.1.0~10 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=3bfe24979d98f8955b1cb9f0ee5359aacab4e98a;p=mudpy.git Relocate delete_account menu function Move the action logic for the delete_account state from its corresponding facet to the menu module, hiding it behind a consistently-named entry point. --- diff --git a/mudpy/menu.py b/mudpy/menu.py index 75dc542..39a5ad2 100644 --- a/mudpy/menu.py +++ b/mudpy/menu.py @@ -76,3 +76,8 @@ def choose_name_create_6(user): def choose_name_create_7(user): """Provide a randomly-generated name as choice 7.""" return mudpy.misc.random_name() + + +def delete_account_action_y(user): + """Permanently delete the account and all avatars, as requested.""" + return user.destroy() diff --git a/share/menu.yaml b/share/menu.yaml index 87176eb..b66074e 100644 --- a/share/menu.yaml +++ b/share/menu.yaml @@ -67,7 +67,7 @@ menu.choose_name.description: Your new avatar needs a name. This will be the unremarkable name forever. menu.choose_name.prompt: "Choose a name for $(tpop):" -menu.delete_account.action_y: user.destroy() +menu.delete_account.action_y: mudpy.menu.delete_account_action_y(user) menu.delete_account.branch_n: main_utility menu.delete_account.branch_y: disconnecting menu.delete_account.choice_n: no, don't delete my account