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

Django 1.11 Upgrade, round 102 #969

Merged
merged 31 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1eb032a
objects.create automatically calls save, so no need to call it again …
kollivier Aug 12, 2018
b124a0d
Revert removed calls to save as we are creating models directly rathe…
kollivier Aug 14, 2018
1fa6904
objects.create automatically calls save, so no need to call it again …
kollivier Aug 12, 2018
6d7b9ba
Revert removed calls to save as we are creating models directly rathe…
kollivier Aug 14, 2018
390cc63
Apply Micah's changes and also fix some new issues uncovered by tests…
kollivier Jul 12, 2018
7307bbf
Fix login template name.
kollivier Jul 13, 2018
655ef38
Actually commit the updated dependency versions to requirements.txt...
kollivier Jul 24, 2018
e1a8d01
use `==` instead of `=` in template `if` statement
micahscopes Jul 25, 2018
5de82a1
Re-delete requirements.txt as a result of rebasing issues.
kollivier Aug 7, 2018
030fb41
Update Django to 1.11 in pipfile after rebase.
kollivier Aug 7, 2018
a05dc76
Actually update the dependencies after accidentally using pip...
kollivier Aug 7, 2018
7a07559
update django to 1.11.15!
aronasorman Aug 16, 2018
5119abb
use the recommended way of declaring our AppConfig
aronasorman Aug 16, 2018
c8537dd
use FormatPresetSerializer as a PrimaryKeyRelatedField serializer
micahscopes Aug 16, 2018
3df6e23
disable breakpoints
micahscopes Aug 16, 2018
f305408
attempted fix for file uploading issues
micahscopes Aug 29, 2018
759da9b
[django1.11] fix file uploading, new user registration + make tests p…
micahscopes Sep 8, 2018
6c52f3a
cleanup some debugging remnants
micahscopes Sep 8, 2018
70a300c
cleanup one last debugging remnant -_-
micahscopes Sep 8, 2018
5b49aff
get file format from extension
micahscopes Sep 10, 2018
2b70d80
Don't query the database to guess file formats. Instead, use le_util…
micahscopes Sep 10, 2018
ff967e3
use in test
micahscopes Sep 11, 2018
90bc5f0
Pipfile.lock
micahscopes Sep 11, 2018
01d8ec5
align auth_login/login URL route name to 'login'
micahscopes Sep 17, 2018
eb6d81f
updated cloudbuild.yaml, courtesy of Aron
micahscopes Sep 18, 2018
89b23c1
Create simplified implementation for gcs_storage.generate_filename
aronasorman Sep 20, 2018
a04bcec
Remove assert about the filename and a string
aronasorman Sep 14, 2018
afa4c10
Partial fix for #975. Restore the Other option textbox in the reg inf…
kollivier Sep 27, 2018
aa36222
Merge branch develop into django-1-11
kollivier Sep 27, 2018
e1e3fc6
Merge branch 'develop' into django-1-11
aronasorman Sep 27, 2018
0d79d7d
Merge branch 'develop' into django-1-11
micahscopes Oct 1, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name = "pypi"

[packages]
django-filter = "==0.9.2"
django-mptt = "==0.8.5"
django-mptt = "==0.9.1"
django-pg-utils = "==0.1.5"
djangorestframework = "==3.3.3"
djangorestframework = "==3.8.2"
pdfkit = "==0.6.1"
"psycopg2-binary" = "==2.7.4"
psutil = "==3.1.1"
Expand Down Expand Up @@ -39,7 +39,7 @@ pathlib = "*"
"xhtml2pdf" = "==0.2.1"
"progressbar2" = "==3.36.0"
python-postmark = "==0.5.0"
Django = "==1.9.13"
Django = "==1.11.15"
Markdown = "==2.6.2"
Pillow = "==5.0.0"
Metaphone = "==0.6"
Expand Down
81 changes: 45 additions & 36 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 18 additions & 6 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ steps:
args: [
'build',
'-f', 'k8s/images/nginx/Dockerfile',
'--cache-from', 'gcr.io/$PROJECT_ID/learningequality-studio-nginx:latest',
'--cache-from', 'gcr.io/$PROJECT_ID/learningequality-studio-nginx:latest',
'-t', 'gcr.io/$PROJECT_ID/learningequality-studio-nginx:$COMMIT_SHA',
'-t', 'gcr.io/$PROJECT_ID/learningequality-studio-nginx:latest',
'.'
Expand Down Expand Up @@ -64,11 +64,22 @@ steps:
- 'CLOUDSDK_CONTAINER_CLUSTER=dev-qa-cluster'
secretEnv: ['POSTMARK_API_KEY']
entrypoint: 'bash'
args: [
'-c',
# still run helm.bash to initialze creds, but otherwise run our own deploy script
'/builder/helm.bash && ./helm-deploy.sh $BRANCH_NAME studio-qa-content $COMMIT_SHA $$POSTMARK_API_KEY arontest $BRANCH_NAME arontest ops-central-studio-qa-sql-proxy-gcloud-sqlproxy.sqlproxy ../gcs-service-account.json'
]
args:
- -c
- >
/builder/helm.bash &&
./helm-deploy.sh
$BRANCH_NAME
studio-qa-content
$COMMIT_SHA
$$POSTMARK_API_KEY
arontest
$BRANCH_NAME
arontest
$PROJECT_ID-studio-qa-sql-proxy-gcloud-sqlproxy.sqlproxy
../gcs-service-account.json
$PROJECT_ID
is_production

timeout: 3600s
secrets:
Expand All @@ -81,3 +92,4 @@ images:
- 'gcr.io/$PROJECT_ID/learningequality-studio-nginx:latest'
- 'gcr.io/$PROJECT_ID/learningequality-studio-app:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/learningequality-studio-app:latest'

2 changes: 0 additions & 2 deletions contentcuration/contentcuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app

default_app_config = "contentcuration.apps.ContentConfig"
15 changes: 8 additions & 7 deletions contentcuration/contentcuration/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import render_to_response, redirect
from django.shortcuts import render, redirect
from django.template import RequestContext
from contentcuration.models import Channel
from contentcuration.utils.policies import check_policies
from django.shortcuts import render

ACCEPTED_BROWSERS = settings.HEALTH_CHECK_BROWSERS + settings.SUPPORTED_BROWSERS

Expand All @@ -18,7 +19,7 @@ def wrap(request, *args, **kwargs):
if expected_agent in user_agent_string:
return function(request, *args, **kwargs)

return render_to_response('unsupported_browser.html', context_instance=RequestContext(request))
return render(request, 'unsupported_browser.html')

wrap.__doc__ = function.__doc__
wrap.__name__ = function.__name__
Expand All @@ -30,7 +31,7 @@ def wrap(request, *args, **kwargs):
if request.user.is_admin:
return function(request, *args, **kwargs)

return render_to_response('unauthorized.html', context_instance=RequestContext(request), status=403)
return render(request, 'unauthorized.html', status=403)

wrap.__doc__ = function.__doc__
wrap.__name__ = function.__name__
Expand All @@ -41,15 +42,15 @@ def wrap(request, *args, **kwargs):
try:
channel = Channel.objects.get(pk=kwargs['channel_id'])
except ObjectDoesNotExist:
return render_to_response('channel_not_found.html', context_instance=RequestContext(request))
return render(request, 'channel_not_found.html')

if channel.public or \
channel.editors.filter(id=request.user.id).exists() or \
channel.viewers.filter(id=request.user.id).exists() or \
request.user.is_admin:
return function(request, *args, **kwargs)

return render_to_response('unauthorized.html', context_instance=RequestContext(request), status=403)
return render(request, 'unauthorized.html', status=403)

wrap.__doc__ = function.__doc__
wrap.__name__ = function.__name__
Expand All @@ -61,11 +62,11 @@ def wrap(request, *args, **kwargs):
channel = Channel.objects.get(pk=kwargs['channel_id'], deleted=False)

if not channel.editors.filter(id=request.user.id).exists() and not request.user.is_admin:
return render_to_response('unauthorized.html', context_instance=RequestContext(request), status=403)
return render(request, 'unauthorized.html', status=403)

return function(request, *args, **kwargs)
except ObjectDoesNotExist:
return render_to_response('channel_not_found.html', context_instance=RequestContext(request))
return render(request, 'channel_not_found.html')

wrap.__doc__ = function.__doc__
wrap.__name__ = function.__name__
Expand Down
1 change: 0 additions & 1 deletion contentcuration/contentcuration/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def __init__(self, *args, **kwargs):
)

countries = [(c.name, translator.gettext(c.name)) for c in list(pycountry.countries)]

self.fields['location'] = forms.ChoiceField(required=True, widget=forms.SelectMultiple, label=_('Where do you plan to use Kolibri? (select all that apply)'), choices=countries)

def clean_email(self):
Expand Down
3 changes: 0 additions & 3 deletions contentcuration/contentcuration/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ class Migration(migrations.Migration):
'verbose_name': 'Topic',
'verbose_name_plural': 'Topics',
},
managers=[
('_default_manager', django.db.models.manager.Manager()),
],
),
migrations.CreateModel(
name='ContentTag',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-08-31 07:45
from __future__ import unicode_literals

import contentcuration.models
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('contentcuration', '0092_auto_20180731_1024'),
]

operations = [
migrations.AlterField(
model_name='file',
name='file_on_disk',
field=models.FileField(blank=True, max_length=500, upload_to=contentcuration.models.object_storage_name),
),
]
Loading