From bc03f679477a1f47535f543ebd10d92c15b9b933 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 24 Jan 2019 14:48:46 +0100 Subject: Make big donation just once! --- talerbank/app/management/commands/provide_accounts.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/talerbank/app/management/commands/provide_accounts.py b/talerbank/app/management/commands/provide_accounts.py index 4a6c545..b8c84e5 100644 --- a/talerbank/app/management/commands/provide_accounts.py +++ b/talerbank/app/management/commands/provide_accounts.py @@ -3,7 +3,8 @@ # # TALER is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 3, or (at your option) any later version. +# published by the Free Software Foundation; either version 3, +# or (at your option) any later version. # # TALER is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of @@ -41,6 +42,14 @@ def make_account(username): username=username, password='x'), is_public=True).save() + if "Survey" == username: + bank = BankAccount.objects.get(account_no=1) + survey = BankAccount.objects.get(account_no=8) + wire_transfer(Amount(settings.TALER_CURRENCY, 10000000), + bank, + survey, + "Benevolent donation for 'Survey'") + except (OperationalError, ProgrammingError): LOGGER.error("db does not exist, or the project" " is not migrated. Try 'taler-bank-manage" @@ -49,14 +58,6 @@ def make_account(username): exc_info=True) sys.exit(1) - if "Survey" == username: - bank = BankAccount.objects.get(account_no=1) - survey = BankAccount.objects.get(account_no=8) - wire_transfer(Amount(settings.TALER_CURRENCY, 10000000), - bank, - survey, - "Benevolent donation for 'Survey'") - class Command(BaseCommand): help = "Provide initial user accounts" -- cgit v1.2.3