Description
Deployment Type
NetBox Cloud
NetBox Version
v4.2.5
Python Version
3.10
Steps to Reproduce
- View a site and click the "Journal" tab.
- 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
)