From 2552e60c72a99145a0f23ea7411fc71ba6bafa52 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 26 Oct 2020 14:03:19 +0000 Subject: [PATCH] Disabled patch warnings when running 'check' command. - Legacy-Id: 18640 --- ietf/checks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ietf/checks.py b/ietf/checks.py index 3bf44f8ac..9f59d36c6 100644 --- a/ietf/checks.py +++ b/ietf/checks.py @@ -299,7 +299,7 @@ def maybe_patch_library(app_configs, **kwargs): errors = [] # Change path to our copy of django (this assumes we're running in a # virtualenv, which we should) - import os, django + import os, django, sys django_path = os.path.dirname(django.__file__) library_path = os.path.dirname(django_path) top_dir = os.path.dirname(settings.BASE_DIR) @@ -321,7 +321,9 @@ def maybe_patch_library(app_configs, **kwargs): )) else: # Patch succeeded or was a no-op - if not patch_set.already_patched and settings.SERVER_MODE != 'production': + if (not patch_set.already_patched + and settings.SERVER_MODE != 'production' + and sys.argv[1] != 'check'): errors.append( checks.Error("Found an unpatched file, and applied the patch in %s" % (patch_file), hint="You will need to re-run the command now that the patch in place.",