diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2017-12-29 13:31:30 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2017-12-29 13:31:30 +0100 |
commit | af81a32e5d304187f50a070a4bc65f87ee90750e (patch) | |
tree | 1822547afc2506df6349ed379d3eac9b22537429 /talerbank/app/management | |
parent | e3c242043b199ddade6ae540bcc8284c0e377d5e (diff) | |
download | bank-af81a32e5d304187f50a070a4bc65f87ee90750e.tar.gz bank-af81a32e5d304187f50a070a4bc65f87ee90750e.tar.bz2 bank-af81a32e5d304187f50a070a4bc65f87ee90750e.zip |
linting everything but (almost) unavoidable things
Diffstat (limited to 'talerbank/app/management')
-rw-r--r-- | talerbank/app/management/commands/dump_talerdb.py | 30 | ||||
-rw-r--r-- | talerbank/app/management/commands/provide_accounts.py | 5 |
2 files changed, 16 insertions, 19 deletions
diff --git a/talerbank/app/management/commands/dump_talerdb.py b/talerbank/app/management/commands/dump_talerdb.py index ba81444..10dc936 100644 --- a/talerbank/app/management/commands/dump_talerdb.py +++ b/talerbank/app/management/commands/dump_talerdb.py @@ -1,16 +1,19 @@ # This file is part of TALER # (C) 2014, 2015, 2106 INRIA # -# 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. +# 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. # -# TALER is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# TALER is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +# You should have received a copy of the GNU General Public +# License along with TALER; see the file COPYING. If not, see +# <http://www.gnu.org/licenses/> # # @author Marcello Stanisci @@ -19,7 +22,6 @@ import logging from django.core.management.base import BaseCommand from django.db.utils import OperationalError, ProgrammingError from ...models import BankAccount, BankTransaction -from .helpers import hard_db_error_log LOGGER = logging.getLogger(__name__) @@ -30,9 +32,11 @@ def dump_accounts(): print("No accounts created yet..") return for acc in accounts: - print(acc.user.username + " has account number " + str(acc.account_no)) + print(acc.user.username + \ + " has account number " + \ + str(acc.account_no)) except (OperationalError, ProgrammingError): - hard_db_error_log() + LOGGER.error("Hard database error, does it exist?") sys.exit(1) @@ -41,15 +45,13 @@ def dump_history(): history = BankTransaction.objects.all() for item in history: msg = [] - # concatenating via 'append' because the + operator put - # as the first/last character on a line makes flake8 complain msg.append("+%s, " % item.credit_account.account_no) msg.append("-%s, " % item.debit_account.account_no) msg.append(item.amount.stringify(2)) msg.append(item.subject) print(''.join(msg)) except (OperationalError, ProgrammingError): - hard_db_error_log() + LOGGER.error("Hard database error, does it exist?") sys.exit(1) diff --git a/talerbank/app/management/commands/provide_accounts.py b/talerbank/app/management/commands/provide_accounts.py index cf8d6e9..6bf8c53 100644 --- a/talerbank/app/management/commands/provide_accounts.py +++ b/talerbank/app/management/commands/provide_accounts.py @@ -45,11 +45,6 @@ def make_account(username): exc_info=True) sys.exit(1) -def basic_accounts(): - ensure_account("Bank") - ensure_account("Exchange") - - class Command(BaseCommand): help = "Provide initial user accounts" |