Skip to content

Treatment of kind field on JournalEntry is inconsistent #18872

Closed
@jeremystretch

Description

@jeremystretch

Deployment Type

NetBox Cloud

NetBox Version

v4.2.5

Python Version

3.10

Steps to Reproduce

  1. View a site and click the "Journal" tab.
  2. Add a journal entry without specifying a kind.

Expected Behavior

The kind field should always be required (AFAICT):

class JournalEntry(...):
    kind = models.CharField(
        verbose_name=_('kind'),
        max_length=30,
        choices=JournalEntryKindChoices,
        default=JournalEntryKindChoices.KIND_INFO
    )

Observed Behavior

The kind field is not required by either the model's form or its REST API serializer.

class JournalEntryForm(NetBoxModelForm):
    kind = forms.ChoiceField(
        label=_('Kind'),
        choices=add_blank_choice(JournalEntryKindChoices),
        required=False
    )
class JournalEntrySerializer(NetBoxModelSerializer):
    kind = ChoiceField(
        choices=JournalEntryKindChoices,
        required=False
    )

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions