Skip to content
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

Merged
merged 2 commits into from
Feb 26, 2019
Merged

Increase path's max_length for ImportedFile model to 4096 #5345

merged 2 commits into from
Feb 26, 2019

Conversation

dojutsu-user
Copy link
Member

Closes #5061

@dojutsu-user dojutsu-user changed the title Increase path's max_lenght for ImportedFile model to 4096 Increase path's max_length for ImportedFile model to 4096 Feb 24, 2019
@@ -1089,7 +1089,7 @@ class ImportedFile(models.Model):
)
name = models.CharField(_('Name'), max_length=255)
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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)
Copy link
Member

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

Copy link
Member Author

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.

@ericholscher ericholscher merged commit ab0546f into readthedocs:master Feb 26, 2019
@dojutsu-user dojutsu-user deleted the increase-path-4096 branch February 26, 2019 11:21
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.

3 participants