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

Task/sapnamysore/tlt 3253/upgrade django #44

Merged
20 changes: 10 additions & 10 deletions canvas_manage_course/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
boto3==1.4.4
Django==1.9.12
cx-Oracle==5.2.1
Django==1.11.9
cx-Oracle==6.1
django-cached-authentication-middleware==0.2.1
django-redis-cache==1.7.1
hiredis==0.2.0
kitchen==1.2.4
ndg-httpsclient==0.4.2
redis==2.10.5
psycopg2==2.6.2
redis==2.10.6
psycopg2==2.7.3.2
requests==2.13.0

git+ssh://[email protected]/penzance/[email protected]#egg=canvas-python-sdk==0.8.4
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-auth-lti==1.2.5
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-icommons-common[async]==1.18.2
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-icommons-ui==1.3.1
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-canvas-lti-school-permissions==0.5.2
git+ssh://[email protected]/penzance/[email protected]#egg=canvas-python-sdk==0.10.2
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-auth-lti==1.2.9

git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-icommons-common[async]==v1.34
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-icommons-ui==1.5.2
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-canvas-lti-school-permissions==0.6
2 changes: 1 addition & 1 deletion canvas_manage_course/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# below are requirements specific to the local environment

ddt==1.1.1
django-debug-toolbar==1.5
django-debug-toolbar==1.8
django-sslserver==0.19
mock==2.0.0
oauthlib==1.1.1
Expand Down
1 change: 1 addition & 0 deletions canvas_manage_course/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.postgres',
'django.contrib.staticfiles',
'django_auth_lti',
'django_rq',
Expand Down
14 changes: 14 additions & 0 deletions canvas_manage_course/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.conf.urls import include, url
from django.conf import settings

from canvas_manage_course import views
from icommons_ui import views as icommons_ui_views
Expand All @@ -15,3 +16,16 @@
url(r'^not_authorized$', icommons_ui_views.not_authorized, name='not_authorized'),
url(r'^tool_config$', views.tool_config, name='tool_config'),
]

# Import the debug toolbar and handle any namespace issues that may occur
# ie: 'djdt' is not a registered namespace
# https://github.com/jazzband/django-debug-toolbar/issues/529
if settings.DEBUG:
try:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]
except:
pass

8 changes: 4 additions & 4 deletions canvas_manage_course/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import logging

from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import redirect, render
from django.urls import reverse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods

from ims_lti_py.tool_config import ToolConfig

from isites_migration.utils import get_previous_isites
Expand All @@ -21,8 +20,9 @@

@require_http_methods(['GET'])
def tool_config(request):
url = "%s://%s%s" % (request.scheme, request.get_host(),
reverse('lti_launch', exclude_resource_link_id=True))

url = "https://{}{}".format(request.get_host(), reverse('lti_launch'))

title = 'Manage Course'
lti_tool_config = ToolConfig(
title=title,
Expand Down
3 changes: 1 addition & 2 deletions isites_migration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from django.conf import settings
from django.db.models import Q
from django.template.loader import get_template
from django.template import Context
from django.db import connections
from django.utils.text import get_valid_filename
from canvas_sdk.methods import content_migrations, files
Expand Down Expand Up @@ -365,7 +364,7 @@ def _export_topic_text(topic_text, topic_title, keyword, zip_file):
def _export_readme(keyword, zip_file, readme_filename):
logger.debug("Exporting readme file for keyword %s", keyword)
readme_template = get_template('isites_migration/export_files_readme.html')
content = readme_template.render(Context({}))
content = readme_template.render({})
zip_file.writestr(os.path.join(keyword, readme_filename), content)
logging.debug("Copied Readme file to export location %s", readme_filename)

Expand Down
2 changes: 1 addition & 1 deletion isites_migration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def index(request):

processes = Process.objects.filter(
name='isites_migration.jobs.migrate_files',
details__at_canvas_course_id=canvas_course_id
details__canvas_course_id=canvas_course_id
).order_by('-date_created')

has_active_process = len([p for p in processes if p.state != Process.COMPLETE]) > 0
Expand Down
126 changes: 63 additions & 63 deletions manage_people/migrations/0002_mp_school_allowed_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,69 @@
from django.db import migrations, models,transaction

SCHOOL_ALOWED_ROLE_DATA = [
('gse', 9, 'N'),
('gse', 10, 'Y'),
('gse', 11, 'N'),
('gse', 12, 'N'),
('gse', 15, 'Y'),
('colgsas', 9, 'N'),
('colgsas', 5, 'N'),
('colgsas', 7, 'N'),
('colgsas', 10, 'Y'),
('colgsas', 11, 'N'),
('gsd', 5, 'N'),
('gsd', 11, 'N'),
('gsd', 12, 'N'),
('gsd', 10, 'Y'),
('hds', 9, 'N'),
('hds', 5, 'N'),
('hds', 7, 'N'),
('hds', 10, 'Y'),
('hds', 11, 'N'),
('hds', 12, 'N'),
('ext', 9, 'N'),
('ext', 5, 'N'),
('ext', 7, 'N'),
('ext', 10, 'Y'),
('ext', 11, 'N'),
('sum', 9, 'N'),
('sum', 5, 'N'),
('sum', 7, 'N'),
('sum', 10, 'Y'),
('sum', 11, 'N'),
('hks', 5, 'N'),
('hks', 10, 'Y'),
('hls', 5, 'N'),
('hls', 7, 'N'),
('hls', 10, 'Y'),
('hls', 11, 'N'),
('hls', 12, 'N'),
('hlsexeced', 5, 'N'),
('hlsexeced', 7, 'N'),
('hlsexeced', 9, 'N'),
('hlsexeced', 10, 'Y'),
('hlsexeced', 11, 'N'),
('hlsexeced', 12, 'N'),
('hlsexeced', 0, 'N'),
('hms', 9, 'N'),
('hms', 5, 'N'),
('hms', 7, 'N'),
('hms', 10, 'Y'),
('hsdm', 9, 'N'),
('hsdm', 5, 'N'),
('hsdm', 7, 'N'),
('hsdm', 10, 'Y'),
('hsph', 9, 'N'),
('hsph', 5, 'N'),
('hsph', 7, 'N'),
('hsph', 10, 'Y'),
('hsph', 11, 'Y'),
('hsph', 12, 'Y'),
('hsph', 15, 'Y'),
('hilr', 9, 'N'),
('hilr', 5, 'N'),
('hilr', 7, 'N'),
('hilr', 10, 'Y')
('gse', 9, False),
('gse', 10, True),
('gse', 11, False),
('gse', 12, False),
('gse', 15, True),
('colgsas', 9, False),
('colgsas', 5, False),
('colgsas', 7, False),
('colgsas', 10, True),
('colgsas', 11, False),
('gsd', 5, False),
('gsd', 11, False),
('gsd', 12, False),
('gsd', 10, True),
('hds', 9, False),
('hds', 5, False),
('hds', 7, False),
('hds', 10, True),
('hds', 11, False),
('hds', 12, False),
('ext', 9, False),
('ext', 5, False),
('ext', 7, False),
('ext', 10, True),
('ext', 11, False),
('sum', 9, False),
('sum', 5, False),
('sum', 7, False),
('sum', 10, True),
('sum', 11, False),
('hks', 5, False),
('hks', 10, True),
('hls', 5, False),
('hls', 7, False),
('hls', 10, True),
('hls', 11, False),
('hls', 12, False),
('hlsexeced', 5, False),
('hlsexeced', 7, False),
('hlsexeced', 9, False),
('hlsexeced', 10, True),
('hlsexeced', 11, False),
('hlsexeced', 12, False),
('hlsexeced', 0, False),
('hms', 9, False),
('hms', 5, False),
('hms', 7, False),
('hms', 10, True),
('hsdm', 9, False),
('hsdm', 5, False),
('hsdm', 7, False),
('hsdm', 10, True),
('hsph', 9, False),
('hsph', 5, False),
('hsph', 7, False),
('hsph', 10, True),
('hsph', 11, True),
('hsph', 12, True),
('hsph', 15, True),
('hilr', 9, False),
('hilr', 5, False),
('hilr', 7, False),
('hilr', 10, True)
]

def populate_school_allowed_role(apps, schema_editor):
Expand Down