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

Conversation

@dojutsu-user
Copy link
Member

@dojutsu-user dojutsu-user commented Feb 23, 2019

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

@ericholscher ericholscher Feb 25, 2019

Believe we want to update the name as well.

Copy link
Member Author

@dojutsu-user dojutsu-user Feb 25, 2019

What should be the optimal value for max_length. I didn't find that in the discussion of #5061

Copy link
Member

@stsewd stsewd Feb 26, 2019

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

@stsewd stsewd Feb 26, 2019

We should add a comment why 4096 is our magic number here

Copy link
Member Author

@dojutsu-user dojutsu-user Feb 26, 2019

Thank you.
I have added the comment and pushed the changes.

@ericholscher ericholscher merged commit ab0546f into readthedocs:master Feb 26, 2019
1 check passed
@dojutsu-user dojutsu-user deleted the increase-path-4096 branch Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants