Skip to content

Commit 3d1b95b

Browse files
committed
Fix timezone support of script log message display
1 parent db7bfa7 commit 3d1b95b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,8 @@
6868

6969
# 0.3.12
7070

71-
* Allow editing of class_name and module_path on ScriptInstance to allow the preservation of ScriptExecutions if the script is moved/renamed.
71+
* Allow editing of class_name and module_path on ScriptInstance to allow the preservation of ScriptExecutions if the script is moved/renamed.
72+
73+
# 0.3.13
74+
75+
* Fix timezone support of script log message display

netbox_script_manager/api/serializers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.template.defaultfilters import date as date_filter
2+
from django.templatetags.tz import localtime
23
from drf_spectacular.types import OpenApiTypes
34
from drf_spectacular.utils import extend_schema_field
45
from netbox.api.fields import ChoiceField
@@ -27,7 +28,7 @@ class FormattedDateTimeField(serializers.Field):
2728
DATE_FORMAT = get_config().DATETIME_FORMAT
2829

2930
def to_representation(self, value):
30-
return date_filter(value, self.DATE_FORMAT)
31+
return date_filter(localtime(value), self.DATE_FORMAT)
3132

3233

3334
class ScriptInstanceSerializer(NetBoxModelSerializer):

0 commit comments

Comments
 (0)