diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-02-25 18:35:09 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-24 19:38:57 +0200 |
commit | bb1bb0cf461766997a1496547edbbdf04ade4bd6 (patch) | |
tree | e8814db451de0fbf54719abec1c0b76dcf9398f8 | |
parent | c07626645154120a66d57dc2805a4e4b844e0bd6 (diff) | |
download | Ishtar-bb1bb0cf461766997a1496547edbbdf04ade4bd6.tar.bz2 Ishtar-bb1bb0cf461766997a1496547edbbdf04ade4bd6.zip |
Regenerate QR codes: add an option to disable https in link generation
-rw-r--r-- | ishtar_common/management/commands/regenerate_qrcodes.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ishtar_common/management/commands/regenerate_qrcodes.py b/ishtar_common/management/commands/regenerate_qrcodes.py index e56573b06..6c1ed8ecc 100644 --- a/ishtar_common/management/commands/regenerate_qrcodes.py +++ b/ishtar_common/management/commands/regenerate_qrcodes.py @@ -40,10 +40,15 @@ class Command(BaseCommand): parser.add_argument('app_name', nargs='?', default=None, choices=APPS) parser.add_argument('model_name', nargs='?', default=None) + parser.add_argument( + '--no-https', dest='no-https', action='store_true', + default=False, + help='Use this parameter if https is not available.') def handle(self, *args, **options): limit = options['app_name'] model_name = options['model_name'] + secure = not options['no-https'] if model_name: model_name = model_name.lower() for app in APPS: @@ -68,6 +73,6 @@ class Command(BaseCommand): cmsg = u"\r{} {}/{}".format(msg, idx + 1, ln) sys.stdout.write(cmsg) sys.stdout.flush() - object.generate_qrcode(secure=False, tmpdir=tmpdir) + object.generate_qrcode(secure=secure, tmpdir=tmpdir) shutil.rmtree(tmpdir) sys.stdout.write("\n") |