diff --git a/canvas_manage_course/requirements/base.txt b/canvas_manage_course/requirements/base.txt index b70fc00..86db461 100644 --- a/canvas_manage_course/requirements/base.txt +++ b/canvas_manage_course/requirements/base.txt @@ -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://git@github.com/penzance/canvas_python_sdk.git@v0.8.4#egg=canvas-python-sdk==0.8.4 -git+ssh://git@github.com/Harvard-University-iCommons/django-auth-lti.git@v1.2.5#egg=django-auth-lti==1.2.5 -git+ssh://git@github.com/Harvard-University-iCommons/django-icommons-common.git@v1.18.2#egg=django-icommons-common[async]==1.18.2 -git+ssh://git@github.com/Harvard-University-iCommons/django-icommons-ui.git@v1.3.1#egg=django-icommons-ui==1.3.1 -git+ssh://git@github.com/Harvard-University-iCommons/django-canvas-lti-school-permissions@v0.5.2#egg=django-canvas-lti-school-permissions==0.5.2 +git+ssh://git@github.com/penzance/canvas_python_sdk.git@v0.10.2#egg=canvas-python-sdk==0.10.2 +git+ssh://git@github.com/Harvard-University-iCommons/django-auth-lti.git@v1.2.9#egg=django-auth-lti==1.2.9 + +git+ssh://git@github.com/Harvard-University-iCommons/django-icommons-common.git@v1.34#egg=django-icommons-common[async]==v1.34 +git+ssh://git@github.com/Harvard-University-iCommons/django-icommons-ui.git@v1.5.2#egg=django-icommons-ui==1.5.2 +git+ssh://git@github.com/Harvard-University-iCommons/django-canvas-lti-school-permissions@v0.6#egg=django-canvas-lti-school-permissions==0.6 \ No newline at end of file diff --git a/canvas_manage_course/requirements/local.txt b/canvas_manage_course/requirements/local.txt index 56841cc..c5bc3f0 100644 --- a/canvas_manage_course/requirements/local.txt +++ b/canvas_manage_course/requirements/local.txt @@ -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 diff --git a/canvas_manage_course/settings/base.py b/canvas_manage_course/settings/base.py index 55a15f4..7ff974e 100644 --- a/canvas_manage_course/settings/base.py +++ b/canvas_manage_course/settings/base.py @@ -37,6 +37,7 @@ 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', + 'django.contrib.postgres', 'django.contrib.staticfiles', 'django_auth_lti', 'django_rq', diff --git a/canvas_manage_course/urls.py b/canvas_manage_course/urls.py index 83bdf96..074ddaf 100644 --- a/canvas_manage_course/urls.py +++ b/canvas_manage_course/urls.py @@ -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 @@ -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 + diff --git a/canvas_manage_course/views.py b/canvas_manage_course/views.py index 604ec35..a223a8a 100644 --- a/canvas_manage_course/views.py +++ b/canvas_manage_course/views.py @@ -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 @@ -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, diff --git a/isites_migration/utils.py b/isites_migration/utils.py index abd17af..2de656f 100644 --- a/isites_migration/utils.py +++ b/isites_migration/utils.py @@ -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 @@ -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) diff --git a/isites_migration/views.py b/isites_migration/views.py index b2eb6e4..d7250a1 100644 --- a/isites_migration/views.py +++ b/isites_migration/views.py @@ -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 diff --git a/manage_people/migrations/0002_mp_school_allowed_roles.py b/manage_people/migrations/0002_mp_school_allowed_roles.py index a25d616..af12371 100644 --- a/manage_people/migrations/0002_mp_school_allowed_roles.py +++ b/manage_people/migrations/0002_mp_school_allowed_roles.py @@ -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):