Using horizon utils get_timezone get timezone

Now get timezone gives error:
Exception Value: 'NoneType' object has no attribute 'upper'

This patch use horizon utils get_timezone get timezone.

Change-Id: I1e1bb4cf645f3aed406f2e593b8bb18bf85627ef
Closes-Bug: #1703152
This commit is contained in:
zhurong 2017-07-09 17:12:07 +08:00
parent 0f21fc1fba
commit 0d92916cff
1 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,8 @@ import pytz
import six
import yaql
from horizon.utils import functions as utils
# WrappingColumn is only available in N-horizon
# This make murano-dashboard compatible with Mitaka-horizon
try:
@ -50,7 +52,7 @@ def ensure_python_obj(obj):
def adjust_datestr(request, datestr):
tz = pytz.timezone(request.session.get('django_timezone'))
tz = pytz.timezone(utils.get_timezone(request))
dt = iso8601.parse_date(datestr).astimezone(tz)
return dt.strftime('%Y-%m-%d %H:%M:%S')