summaryrefslogtreecommitdiff
path: root/talerbank/app/management
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-04-14 17:48:53 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-04-14 17:48:53 +0200
commit58402f3461154f86128b6ac68db355b2fe4790bd (patch)
treeb578e8dd3c8213c7eed6c1555606405e4c79b8a8 /talerbank/app/management
parentaff12041143051c8e553bd9fab71b6985d473eee (diff)
downloadbank-58402f3461154f86128b6ac68db355b2fe4790bd.tar.gz
bank-58402f3461154f86128b6ac68db355b2fe4790bd.tar.bz2
bank-58402f3461154f86128b6ac68db355b2fe4790bd.zip
Remove bank_admin.
django-admin changepassword <user> already implements that functionality
Diffstat (limited to 'talerbank/app/management')
-rw-r--r--talerbank/app/management/commands/bank_admin.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/talerbank/app/management/commands/bank_admin.py b/talerbank/app/management/commands/bank_admin.py
deleted file mode 100644
index c4b747f..0000000
--- a/talerbank/app/management/commands/bank_admin.py
+++ /dev/null
@@ -1,57 +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 random import randint
-from django.core.management.base import BaseCommand
-from django.contrib.auth.models import User
-import argparse
-
-def main(options):
- if options['op'] != 'users':
- print("Operation not supported")
- return
- if 'reset_password' not in options:
- print("Only --reset-password allowed")
- return
- try:
- username = options['reset_password'].pop(0)
- new_password = options['reset_password'].pop(0)
- user = User.objects.get(username=username)
- user.set_password(new_password)
- user.save()
-
- except User.DoesNotExist:
- print("Non existent user, exiting..")
- return
-
- except OperationalError:
- print("Non existent DB, exiting..")
- return
-
-class Command(BaseCommand):
- help = "Tool for doing various administration tasks"
-
- def add_arguments(self, parser):
- parser.add_argument('op',
- help="Switch on the type of operation to accomplish."
- " Supported switches are: 'users'")
- parser.add_argument('--reset-password',
- nargs=2,
- metavar=('USER', 'NEWPASS'),
- help="Change USER's password to NEWPASS")
-
- def handle(self, *args, **options):
- main(options)