[perf-web] Fix error with timezone setting
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perf-web] Fix error with timezone setting
- Date: Fri, 25 Jul 2014 10:06:32 +0000 (UTC)
commit a6925526750b23824c55fd782984dbd22f35bdf5
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Fri Jul 25 12:05:34 2014 +0200
Fix error with timezone setting
datetime.replace() returns a new datetime, it doesn't mutate.
metrics/views.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/metrics/views.py b/metrics/views.py
index 136dbbf..5140714 100644
--- a/metrics/views.py
+++ b/metrics/views.py
@@ -330,8 +330,7 @@ def process_report(data, machine_name):
pull_time_str = child_string(data, 'pullTime')
try:
- pull_time = datetime.strptime(pull_time_str, '%Y-%m-%d %H:%M:%S')
- pull_time.replace(tzinfo=timezone.utc)
+ pull_time = datetime.strptime(pull_time_str, '%Y-%m-%d %H:%M:%S').replace(tzinfo=timezone.utc)
except ValueError:
raise ValidationError("Can't parse property 'pullTime'")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]