-
-
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
Django 1.11 upgrade #4750
Merged
Merged
Django 1.11 upgrade #4750
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c4be92c
Update to django 1.10.8
stsewd 3cb8035
Update middlewares to new style
stsewd c4dff93
Update password hash in fixtures
stsewd 964b292
Merge branch 'update-django-10x' of https://github.com/stsewd/readthe…
davidfischer 4c3533f
Update tastypie
stsewd a2c3028
Change authorization class for ProjectResource
stsewd e73251d
Update test
stsewd 26d5cb6
Fix docstring
stsewd 58b452b
Update tastypie
stsewd 0874d20
Merge branch 'update-tastypie' of https://github.com/stsewd/readthedo…
davidfischer c464d1d
Upgrade Django to 1.11
davidfischer 8db6096
Fix tests for 1.11
davidfischer 9f2c9bd
Migrate old passwords to be unusable
davidfischer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.16 on 2018-10-11 17:28 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
def forwards_func(apps, schema_editor): | ||
User = apps.get_model('auth', 'User') | ||
|
||
old_password_patterns = ( | ||
'sha1$', | ||
# RTD's production database doesn't have any of these | ||
# but they are included for completeness | ||
'md5$', | ||
'crypt$', | ||
) | ||
for pattern in old_password_patterns: | ||
users = User.objects.filter(password__startswith=pattern) | ||
for user in users: | ||
user.set_unusable_password() | ||
user.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0004_ad-opt-out'), | ||
('auth', '0008_alter_user_username_max_length'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forwards_func), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,7 @@ def INSTALLED_APPS(self): # noqa | |
def USE_PROMOS(self): # noqa | ||
return 'readthedocsext.donate' in self.INSTALLED_APPS | ||
|
||
MIDDLEWARE_CLASSES = ( | ||
MIDDLEWARE = ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will require a change in |
||
'readthedocs.core.middleware.ProxyMiddleware', | ||
'readthedocs.core.middleware.FooterNoSessionMiddleware', | ||
'django.middleware.locale.LocaleMiddleware', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,12 @@ mkdocs==0.17.3 | |
# Markdown 3.0 breaks with older Django Rest Framework | ||
Markdown<3.0 | ||
|
||
django==1.9.13 | ||
django==1.11.16 | ||
six==1.11.0 | ||
future==0.16.0 | ||
|
||
# django-tastypie 0.13.x and 0.14.0 are not compatible with our code | ||
django-tastypie==0.13.0 | ||
# django-tastypie 0.14.0 drops support for django 1.9 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are migrating to django 1.11 we may be possible to use 0.14.x here, I think. |
||
django-tastypie==0.13.3 | ||
|
||
django-guardian==1.4.9 | ||
django-extensions==2.1.2 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You inverted the logic of the test here.
Don't we still need the test for testing that it's possible to use the API as super user to create a project?
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 decided to remove the creation of a project using the api, it was never documented anyway.
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.
On this change specifically, there's more backstory in #4325.