From 214a74163fd5b08deaf06c9833b144d50f8b6468 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 30 Apr 2015 08:04:33 +0200 Subject: [PATCH] Forcing DEBUG disabled in timeline command --- taiga/timeline/management/commands/rebuild_timeline.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/taiga/timeline/management/commands/rebuild_timeline.py b/taiga/timeline/management/commands/rebuild_timeline.py index 7747eae6..e8e48972 100644 --- a/taiga/timeline/management/commands/rebuild_timeline.py +++ b/taiga/timeline/management/commands/rebuild_timeline.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand from django.db.models import Model @@ -111,5 +112,10 @@ def generate_timeline(): class Command(BaseCommand): def handle(self, *args, **options): + debug_enabled = settings.DEBUG + if debug_enabled: + print("Please, execute this script only with DEBUG mode disabled (DEBUG=False)") + return + Timeline.objects.all().delete() generate_timeline()