Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E611AD4B7 for ; Fri, 21 Sep 2012 20:57:52 +0000 (UTC) Received: (qmail 1741 invoked by uid 500); 21 Sep 2012 20:57:52 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 1721 invoked by uid 500); 21 Sep 2012 20:57:52 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Delivered-To: moderator for allura-commits@incubator.apache.org Received: (qmail 4433 invoked by uid 99); 21 Sep 2012 20:18:34 -0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brondsem@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [7/16] git commit: [#4445] Changed datetime.now() call to datetime.utcnow() and added comment explaining FixedOffset Message-Id: <20120921201834.05C4038CD4@tyr.zones.apache.org> Date: Fri, 21 Sep 2012 20:18:34 +0000 (UTC) [#4445] Changed datetime.now() call to datetime.utcnow() and added comment explaining FixedOffset Signed-off-by: Cory Johns Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/22635482 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/22635482 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/22635482 Branch: refs/heads/master Commit: 226354826b98f6200018e22071856b93a7550f81 Parents: 896380a Author: Cory Johns Authored: Fri Sep 21 14:26:11 2012 +0000 Committer: Dave Brondsema Committed: Fri Sep 21 14:55:56 2012 +0000 ---------------------------------------------------------------------- Allura/allura/lib/plugin.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/22635482/Allura/allura/lib/plugin.py ---------------------------------------------------------------------- diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py index 9c46116..f0c923c6 100644 --- a/Allura/allura/lib/plugin.py +++ b/Allura/allura/lib/plugin.py @@ -342,7 +342,10 @@ class ProjectRegistrationProvider(object): ''' if security.has_access(neighborhood, 'admin', user=user)(): return - now = datetime.now().replace(tzinfo=FixedOffset(0, 'UTC')) + # have to have the replace because, despite being UTC, + # the result from utcnow() is still offset-naive :-( + # maybe look into making the mongo connection offset-naive? + now = datetime.utcnow().replace(tzinfo=FixedOffset(0, 'UTC')) project_count = len(list(user.my_projects())) rate_limits = json.loads(config.get('project.rate_limits', '{}')) for rate, count in rate_limits.items():