From 5c10b30c24ef7331d6053a82c1a94844f3259f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 23 Jul 2020 01:15:46 +0800 Subject: [PATCH] Added confirmation to the accounting_sample command in the accounting application. --- accounting/management/commands/accounting_sample.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accounting/management/commands/accounting_sample.py b/accounting/management/commands/accounting_sample.py index e8e341b..702e0d3 100644 --- a/accounting/management/commands/accounting_sample.py +++ b/accounting/management/commands/accounting_sample.py @@ -46,6 +46,10 @@ class Command(BaseCommand): *args (list[str]): The command line arguments. **options (dict[str,str]): The command line switches. """ + print("This may mess up your data. Continue? [Y/N] ", end="") + if input().lower() not in ("y", "yes"): + return + user = User(sn=923153018, login_id="imacat", password="5486b64881adaf7bc1485cc26e57e51e", name="依瑪貓", is_disabled=False, is_deleted=False)