From 9a88ccda57629a10edd07c6610dfd512ff333bc9 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 9 Dec 2025 15:34:37 -0800 Subject: [PATCH] #294 fix created-by for CO journal entry --- netbox_custom_objects/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/netbox_custom_objects/views.py b/netbox_custom_objects/views.py index e7e261a..117112a 100644 --- a/netbox_custom_objects/views.py +++ b/netbox_custom_objects/views.py @@ -66,6 +66,11 @@ class CustomJournalEntryEditView(generic.ObjectEditView): queryset = JournalEntry.objects.all() form = CustomJournalEntryForm + def alter_object(self, obj, request, args, kwargs): + if not obj.pk: + obj.created_by = request.user + return obj + def get_return_url(self, request, instance): """ Override to return the correct URL for custom objects.