From d3463b596ae5f196af922e72225a68f7f56f6b1c Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jan 2020 12:00:24 -0500 Subject: [PATCH] Closes #4005: Include timezone context in webhook timestamps --- docs/release-notes/version-2.7.md | 1 + netbox/extras/webhooks.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index 5ca486137..c8e47fa15 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -4,6 +4,7 @@ * [#3310](https://github.com/netbox-community/netbox/issues/3310) - Pre-select site/rack for B side when creating a new cable * [#3509](https://github.com/netbox-community/netbox/issues/3509) - Add IP address variables for custom scripts +* [#4005](https://github.com/netbox-community/netbox/issues/4005) - Include timezone context in webhook timestamps ## Bug Fixes diff --git a/netbox/extras/webhooks.py b/netbox/extras/webhooks.py index 04eca4dfe..cfa05d0f6 100644 --- a/netbox/extras/webhooks.py +++ b/netbox/extras/webhooks.py @@ -3,6 +3,7 @@ import hashlib import hmac from django.contrib.contenttypes.models import ContentType +from django.utils import timezone from extras.models import Webhook from utilities.api import get_serializer_for_model @@ -62,7 +63,7 @@ def enqueue_webhooks(instance, user, request_id, action): serializer.data, instance._meta.model_name, action, - str(datetime.datetime.now()), + str(timezone.now()), user.username, request_id )