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

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

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

Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@stsewd
Copy link
Member

stsewd commented Nov 2, 2018

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

@codecov
Copy link

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
@stsewd stsewd deleted the shorten-project-name branch November 2, 2018 20:26
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.

2 participants