-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase path's max_length for ImportedFile model to 4096 #5345
Increase path's max_length for ImportedFile model to 4096 #5345
Conversation
@@ -1089,7 +1089,7 @@ class ImportedFile(models.Model): | |||
) | |||
name = models.CharField(_('Name'), max_length=255) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Believe we want to update the name
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should be the optimal value for max_length
. I didn't find that in the discussion of #5061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name only saves the filename not the full path with directories, so the limitation for filenames is only 255
, so we are safe.
@@ -1089,7 +1089,7 @@ class ImportedFile(models.Model): | |||
) | |||
name = models.CharField(_('Name'), max_length=255) | |||
slug = models.SlugField(_('Slug')) | |||
path = models.CharField(_('Path'), max_length=255) | |||
path = models.CharField(_('Path'), max_length=4096) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a comment why 4096 is our magic number here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
I have added the comment and pushed the changes.
Closes #5061