diff options
Diffstat (limited to 'talerbank/app/management/commands/check_db.py')
-rw-r--r-- | talerbank/app/management/commands/check_db.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/talerbank/app/management/commands/check_db.py b/talerbank/app/management/commands/check_db.py deleted file mode 100644 index 9fb82b9..0000000 --- a/talerbank/app/management/commands/check_db.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 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, If not, see <http://www.gnu.org/licenses/> -# -# @author Marcello Stanisci - -from django.core.management.base import BaseCommand -from django.contrib.auth.models import User -from django.db.utils import OperationalError - - -def check_db(): - try: - bank = User.objects.get(username='Bank') - print ("The DB contains the bank's bank account, so it is assumed to" - " work properly") - except User.DoesNotExist: - print("\n*****WARNING*****\nCreate predefined accounts" - " before running the bank.\n" - "Try 'taler-bank-manage --preaccounts\n\n" - "**********\n") - return 1 - except OperationalError: - print("\n*****WARNING*****\n\nPlease create 'talertest'" - " database before running the bank.\n" - "Create also predefined accounts (with" - " 'taler-bank-manage --preaccounts')\n\n" - "**********\n") - return 1 - return 0 - - -class Command(BaseCommand): - def handle(self, *args, **options): - check_db() |