-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: Update link to prod site, and add passable copy. Fix list in base settings and middleware in test settings. Add fa_info app to course manager.
- Loading branch information
Showing
13 changed files
with
128 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,6 @@ secure*.py* | |
!secure.py.j2 | ||
data/ | ||
http_static/ | ||
cert.pem | ||
key.pem | ||
.envrc |
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
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
Empty file.
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,33 @@ | ||
{% extends 'canvas_manage_course/base.html' %} | ||
|
||
{% load static %} | ||
|
||
{% block stylesheet %} | ||
{{ block.super }} | ||
<link href="{% static 'canvas_manage_course/css/dashboard.css' %}" | ||
rel="stylesheet"/> | ||
{% endblock stylesheet %} | ||
|
||
|
||
{% block dashboard_breadcrumb %} | ||
<nav> | ||
<h1> | ||
<a href="{% url 'dashboard_course' %}">Manage Course</a> | ||
<small><i class="fa fa-chevron-right"></i></small> Final Assessment Form | ||
</h1> | ||
</nav> | ||
{% endblock dashboard_breadcrumb %} | ||
|
||
|
||
{% block tool_content %} | ||
<main> | ||
<div id="content" role="main"> | ||
We were unable to route you directly to this course's Final Assessment Form | ||
in my.harvard. You can follow the instructions on | ||
<a href="https://harvard.service-now.com/ithelp?id=kb_article&sys_id=e809be2a1bda8890efd8a79b2d4bcbb6"> | ||
this knowledge base article | ||
</a> | ||
to complete the form. | ||
</div> | ||
</main> | ||
{% endblock tool_content %} |
Empty file.
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,26 @@ | ||
from django.test import RequestFactory, TestCase | ||
from icommons_common.models import Course, CourseInstance, Term | ||
from mock import Mock | ||
|
||
class FaInfoTestCase(TestCase): | ||
def setUp(self): | ||
self.resource_link_id = uuid.uuid4().hex | ||
self.user_id = uuid.uuid4().hex | ||
self.request = Mock(session={}, method='GET', | ||
resource_link_id=self.resource_link_id) | ||
elf.request.user = Mock(is_authenticated=Mock(return_value=True)) | ||
self.request.LTI = { | ||
'lis_course_offering_sourcedid': self.course_instance_id, | ||
'lis_person_sourcedid': self.user_id, | ||
# 'resource_link_id': self.resource_link_id, | ||
} | ||
|
||
term = Term.objects.create(cs_strm=1234) | ||
course = Course.objects.create(registrar_code='56k78') | ||
CourseInstance.objects.create(course=course, term=term, course_instance_id=1) | ||
|
||
def test_index_redirect(self): | ||
pass | ||
|
||
def test_index_redirect_fail(self): | ||
pass |
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,7 @@ | ||
from django.urls import path | ||
|
||
from fa_info import views | ||
|
||
urlpatterns = [ | ||
path('index', views.index, name='index'), | ||
] |
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,24 @@ | ||
from django.contrib.auth.decorators import login_required | ||
from django.shortcuts import redirect, render | ||
from django.views.decorators.http import require_http_methods | ||
from icommons_common.models import CourseInstance | ||
from lti_school_permissions.decorators import lti_permission_required | ||
|
||
@login_required | ||
@lti_permission_required('fa_info') | ||
@require_http_methods(['GET']) | ||
def index(request): | ||
""" Returns a redirect to the course's FAINFO page """ | ||
course_instance_id = request.LTI['lis_course_offering_sourcedid'] | ||
course_instance = CourseInstance.objects.get(course_instance_id=course_instance_id) | ||
|
||
term_id = course_instance.term.cs_strm | ||
course_id = course_instance.course.registrar_code | ||
url = "https://portal.my.harvard.edu/psp/hrvihprd/EMPLOYEE/HRMS/c/HU_FINAL"\ | ||
"_ASSMNT.HU_FINAL_ASSMNT.GBL?Page=HU_EXAM_ROSTER_INS&Action=U&ExactKey"\ | ||
"s=Y&INSTITUTION=HRVRD&ACAD_CAREER=FAS&STRM={}&CRSE_ID={}".format(term_id, course_id) | ||
if not term_id or not course_id: | ||
return render(request, 'fa_info/index.html') | ||
return redirect(url) | ||
|
||
|