File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 44
55### Enhancements
66
7+ * [ #6850 ] ( https://github.com/netbox-community/netbox/issues/6850 ) - Default to current user when creating journal entries via REST API
78* [ #7462 ] ( https://github.com/netbox-community/netbox/issues/7462 ) - Include count of assigned virtual machines under platform view
89
910### Bug Fixes
Original file line number Diff line number Diff line change 1+ from django .contrib .auth .models import User
12from django .contrib .contenttypes .models import ContentType
23from django .core .exceptions import ObjectDoesNotExist
34from drf_yasg .utils import swagger_serializer_method
3031 'ExportTemplateSerializer' ,
3132 'ImageAttachmentSerializer' ,
3233 'JobResultSerializer' ,
34+ 'JournalEntrySerializer' ,
3335 'ObjectChangeSerializer' ,
3436 'ReportDetailSerializer' ,
3537 'ReportSerializer' ,
@@ -192,6 +194,12 @@ class JournalEntrySerializer(ValidatedModelSerializer):
192194 queryset = ContentType .objects .all ()
193195 )
194196 assigned_object = serializers .SerializerMethodField (read_only = True )
197+ created_by = serializers .PrimaryKeyRelatedField (
198+ allow_null = True ,
199+ queryset = User .objects .all (),
200+ required = False ,
201+ default = serializers .CurrentUserDefault ()
202+ )
195203 kind = ChoiceField (
196204 choices = JournalEntryKindChoices ,
197205 required = False
You can’t perform that action at this time.
0 commit comments