Skip to content

fix cvss model to match released migration 0010#784

Merged
furlongm merged 1 commit intomainfrom
cvss-fix
Mar 5, 2026
Merged

fix cvss model to match released migration 0010#784
furlongm merged 1 commit intomainfrom
cvss-fix

Conversation

@furlongm
Copy link
Owner

@furlongm furlongm commented Mar 5, 2026

eb09bfe fixed the migrations but missed updating the model definition.
vector_string max_length=128 in the model would reject cvss v4.0 vectors
at the python level and cause makemigrations to generate a backwards
migration. no new migration needed as 0010 already set the db column
to 255.

eb09bfe fixed the migrations but missed updating the model definition.
vector_string max_length=128 in the model would reject cvss v4.0 vectors
at the python level and cause makemigrations to generate a backwards
migration. no new migration needed as 0010 already set the db column
to 255.
Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth considering. View full project report here.

severity = models.CharField(max_length=128, blank=True, null=True)
version = models.DecimalField(max_digits=2, decimal_places=1)
vector_string = models.CharField(max_length=128, blank=True, null=True)
vector_string = models.CharField(max_length=255, blank=True, null=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vector_string = models.CharField(max_length=255, blank=True, null=True)
vector_string = models.CharField(max_length=255, blank=True, default='')

null=True on a string field causes inconsistent data types because the value can be either str or None. This adds complexity and maybe bugs, but can be solved by replacing null=True with default="". More info.

@furlongm furlongm merged commit 3f01210 into main Mar 5, 2026
4 checks passed
@furlongm furlongm deleted the cvss-fix branch March 5, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant