From 40763b58bdad0892efff418ade3d98fc8cf184d6 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Tue, 28 Nov 2023 14:01:03 -0800 Subject: [PATCH] 14299 change webhook timestamp to isoformat (#14331) * 14299 change timestamp to isoformat * Omit redundant str() casting --------- Co-authored-by: Jeremy Stretch --- netbox/core/models/jobs.py | 2 +- netbox/extras/webhooks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/core/models/jobs.py b/netbox/core/models/jobs.py index 61b0e64fa..d52cbe165 100644 --- a/netbox/core/models/jobs.py +++ b/netbox/core/models/jobs.py @@ -229,7 +229,7 @@ class Job(models.Model): model_name=self.object_type.model, event=event, data=self.data, - timestamp=str(timezone.now()), + timestamp=timezone.now().isoformat(), username=self.user.username, retry=get_rq_retry() ) diff --git a/netbox/extras/webhooks.py b/netbox/extras/webhooks.py index 1fc869ee8..a22f73c27 100644 --- a/netbox/extras/webhooks.py +++ b/netbox/extras/webhooks.py @@ -115,7 +115,7 @@ def flush_webhooks(queue): event=data['event'], data=data['data'], snapshots=data['snapshots'], - timestamp=str(timezone.now()), + timestamp=timezone.now().isoformat(), username=data['username'], request_id=data['request_id'], retry=get_rq_retry()