Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3C8CFE00D21; Wed, 2 Sep 2015 09:04:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.115 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 7AFB2E00C4D for ; Wed, 2 Sep 2015 09:04:41 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 02 Sep 2015 09:04:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,454,1437462000"; d="scan'208";a="553924314" Received: from sbron-mobl3.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.10.104]) by FMSMGA003.fm.intel.com with ESMTP; 02 Sep 2015 09:04:22 -0700 From: Elliot Smith To: toaster@yoctoproject.org Date: Wed, 2 Sep 2015 17:04:12 +0100 Message-Id: <1441209853-32219-3-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1441209853-32219-1-git-send-email-elliot.smith@intel.com> References: <1441209853-32219-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 2/3] toaster: Remove cast to date which causes errors during test X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2015 16:04:43 -0000 Converting to a naive date while preparing data for the view causes warnings on the console: "RuntimeWarning: DateTimeField Build.started_on received a naive datetime (2015-09-01 00:00:00) while time zone support is active" Remove the conversion to a Python date, which is unnecessary anyway. Signed-off-by: Elliot Smith --- bitbake/lib/toaster/toastergui/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 91bc2fa..395d955 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -40,7 +40,7 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponseBadRequest, HttpResponseNotFound from django.utils import timezone from django.utils.html import escape -from datetime import timedelta, datetime, date +from datetime import timedelta, datetime from django.utils import formats from toastergui.templatetags.projecttags import json as jsonfilter import json @@ -431,8 +431,7 @@ def _modify_date_range_filter(filter_string): def _add_daterange_context(queryset_all, request, daterange_list): # calculate the exact begining of local today and yesterday today_begin = timezone.localtime(timezone.now()) - today_begin = date(today_begin.year,today_begin.month,today_begin.day) - yesterday_begin = today_begin-timedelta(days=1) + yesterday_begin = today_begin - timedelta(days=1) # add daterange persistent context_date = {} context_date['last_date_from'] = request.GET.get('last_date_from',timezone.localtime(timezone.now()).strftime("%d/%m/%Y")) -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.