Conversation
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.
Contributor
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.