Skip to content

Commit d3463b5

Browse files
committed
Closes #4005: Include timezone context in webhook timestamps
1 parent 6297121 commit d3463b5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/release-notes/version-2.7.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* [#3310](https://github.com/netbox-community/netbox/issues/3310) - Pre-select site/rack for B side when creating a new cable
66
* [#3509](https://github.com/netbox-community/netbox/issues/3509) - Add IP address variables for custom scripts
7+
* [#4005](https://github.com/netbox-community/netbox/issues/4005) - Include timezone context in webhook timestamps
78

89
## Bug Fixes
910

netbox/extras/webhooks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import hmac
44

55
from django.contrib.contenttypes.models import ContentType
6+
from django.utils import timezone
67

78
from extras.models import Webhook
89
from utilities.api import get_serializer_for_model
@@ -62,7 +63,7 @@ def enqueue_webhooks(instance, user, request_id, action):
6263
serializer.data,
6364
instance._meta.model_name,
6465
action,
65-
str(datetime.datetime.now()),
66+
str(timezone.now()),
6667
user.username,
6768
request_id
6869
)

0 commit comments

Comments
 (0)