Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions netbox_custom_objects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down