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 | 01945a4aeca368458236cf022b64be2b3539e66b (patch) | |
tree | e8814db451de0fbf54719abec1c0b76dcf9398f8 /ishtar_common | |
parent | 8dccaabb0cfba95d618bd6231371dd7466ea241b (diff) | |
download | Ishtar-01945a4aeca368458236cf022b64be2b3539e66b.tar.bz2 Ishtar-01945a4aeca368458236cf022b64be2b3539e66b.zip |
Regenerate QR codes: add an option to disable https in link generation
Diffstat (limited to 'ishtar_common')
-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") |