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

Shorten project name to match slug length #4856

Merged
merged 2 commits into from Nov 2, 2018
Merged

Conversation

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Nov 2, 2018

This updates the just-merged migration to handle name as well

This updates the just-merged migration to handle name as well
@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Nov 2, 2018

We shouldn't even hit this migration in prod:

In [26]: Project.objects.annotate(text_len=Length('name')).filter(text_len__gt=63).count()
Out[26]: 0

stsewd
stsewd approved these changes Nov 2, 2018
Copy link
Member

@stsewd stsewd left a comment

LGTM

@@ -80,7 +80,7 @@ class Project(models.Model):
# Generally from conf.py
users = models.ManyToManyField(User, verbose_name=_('User'),
related_name='projects')
name = models.CharField(_('Name'), max_length=255)
name = models.CharField(_('Name'), max_length=63)
# A DNS label can contain up to 63 characters.
Copy link
Member

@stsewd stsewd Nov 2, 2018

Maybe is worth to move the comment above, so it covers both, name and slug?

@stsewd
Copy link
Member

@stsewd stsewd commented Nov 2, 2018

Looks like the migration check wants to see a new migration file

@codecov
Copy link

@codecov codecov bot commented Nov 2, 2018

Codecov Report

Merging #4856 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master    #4856   +/-   ##
=======================================
  Coverage   76.41%   76.41%           
=======================================
  Files         158      158           
  Lines        9990     9990           
  Branches     1262     1262           
=======================================
  Hits         7634     7634           
  Misses       2016     2016           
  Partials      340      340
Impacted Files Coverage Δ
readthedocs/projects/models.py 85.5% <100%> (ø) ⬆️

@ericholscher ericholscher merged commit 235303d into master Nov 2, 2018
3 checks passed
@stsewd stsewd deleted the shorten-project-name branch Nov 2, 2018
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

2 participants