Преглед изворни кода

HUE-1910 [oozie] Set default TZ to browser TZ

krish пре 10 година
родитељ
комит
5f8b24c

+ 1 - 2
apps/oozie/src/oozie/models2.py

@@ -29,7 +29,6 @@ from django.core.urlresolvers import reverse
 from django.utils.encoding import force_unicode
 from django.utils.translation import ugettext as _
 
-from desktop.conf import TIME_ZONE
 from desktop.lib import django_mako
 from desktop.lib.exceptions_renderable import PopupException
 from desktop.lib.i18n import smart_str
@@ -1821,7 +1820,7 @@ class Coordinator(Job):
               'frequency_unit': 'days',
               'cron_frequency': '0 0 * * *',
               'cron_advanced': False,
-              'timezone': TIME_ZONE.get(),
+              'timezone': '',
               'start': '${start_date}',
               'end': '${end_date}',
               'workflow': None,

+ 4 - 1
apps/oozie/src/oozie/static/oozie/js/coordinator-editor.ko.js

@@ -114,7 +114,7 @@ var Coordinator = function (vm, coordinator) {
       'show_advanced': false,
       'use_done_flag': false,
       'done_flag': '_SUCCESS',
-      'timezone': coordinator.properties.timezone,
+      'timezone': tzdetect.matches()[0],
       'same_timezone': true,
       'instance_choice': 'default',
       'is_advanced_start_instance': false,
@@ -144,6 +144,9 @@ var Coordinator = function (vm, coordinator) {
 var CoordinatorEditorViewModel = function (coordinator_json, credentials_json, workflows_json, can_edit_json) {
   var self = this;
 
+  if (! coordinator_json['properties']['timezone']) {
+    coordinator_json['properties']['timezone'] = tzdetect.matches()[0];
+   }
   self.canEdit = ko.mapping.fromJS(can_edit_json);
   self.isEditing = ko.observable(coordinator_json.id == null);
   self.isEditing.subscribe(function (newVal) {