From 81f61ddf7936ad7891e94e77cb5d8409d6c60123 Mon Sep 17 00:00:00 2001 From: fmareuil <fmareuil@pasteur.fr> Date: Wed, 10 Mar 2021 16:55:01 +0100 Subject: [PATCH] add commandError --- ippisite/ippidb/management/commands/update_mrc_files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ippisite/ippidb/management/commands/update_mrc_files.py b/ippisite/ippidb/management/commands/update_mrc_files.py index 723b0a31..be8c4b75 100644 --- a/ippisite/ippidb/management/commands/update_mrc_files.py +++ b/ippisite/ippidb/management/commands/update_mrc_files.py @@ -23,9 +23,9 @@ def isolevel_float(arg): try: f = float(arg) except ValueError: - raise argparse.ArgumentTypeError("Must be a floating point number") + raise CommandError("Must be a floating point number") if f < 0 or f > 1.0: - raise argparse.ArgumentTypeError("Argument must be < 1.0 and > 0") + raise CommandError("Argument must be < 1.0 and > 0") return f @@ -147,7 +147,7 @@ class Command(AppCommand): with open(data, "rb") as f: interactfile.interact_file.delete() interactfile.interact_file.save(os.path.basename(data), File(f)) - interactfile.default_isolevel=options["default_isolevel"] + interactfile.default_isolevel = options["default_isolevel"] interactfile.save() self.stdout.write( self.style.SUCCESS( -- GitLab