Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion security/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CVSS(models.Model):
score = models.DecimalField(max_digits=3, decimal_places=1, null=True)
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.


class Meta:
unique_together = ['score', 'severity', 'version', 'vector_string']
Expand Down