diff --git a/network-api/networkapi/fellows/admin.py b/network-api/networkapi/fellows/admin.py deleted file mode 100644 index 4185d360e9a..00000000000 --- a/network-api/networkapi/fellows/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -# from django.contrib import admin - -# Register your models here. diff --git a/network-api/networkapi/fellows/models.py b/network-api/networkapi/fellows/models.py deleted file mode 100644 index 0b4331b362b..00000000000 --- a/network-api/networkapi/fellows/models.py +++ /dev/null @@ -1,3 +0,0 @@ -# from django.db import models - -# Create your models here. diff --git a/network-api/networkapi/fellows/tests.py b/network-api/networkapi/fellows/tests.py deleted file mode 100644 index a79ca8be565..00000000000 --- a/network-api/networkapi/fellows/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -# from django.test import TestCase - -# Create your tests here. diff --git a/source/js/fellowships.js b/source/js/fellowships.js index d608de00446..c0e2b79e1c6 100644 --- a/source/js/fellowships.js +++ b/source/js/fellowships.js @@ -8,7 +8,7 @@ import LoadingIndicator from './components/loading-indicator/loading-indicator.j let pulseApiDomain = ``; let pulseDomain = ``; -const DIRECOTRY_PAGE_FILTER_OPTIONS = {'program_year': `2017`}; +const DIRECTORY_PAGE_FILTER_OPTIONS = {'program_year': `2017`}; const DIRECTORY_PAGE_TYPE_ORDER = [ `science`, `open web`, `tech policy`, `media`]; function getFellows(params, callback) { @@ -17,9 +17,7 @@ function getFellows(params, callback) { let queryString = Object.entries(params).map(pair => pair.map(encodeURIComponent).join(`=`)).join(`&`); let req = new XMLHttpRequest(); - req.addEventListener(`load`, () => { - callback.call(this, JSON.parse(req.response)); - }); + req.addEventListener(`load`, () => callback(JSON.parse(req.response))); req.open(`GET`, `https://${pulseApiDomain}/api/pulse/profiles/?${queryString}`); req.send(); @@ -60,12 +58,14 @@ function groupFellowsByAttr(attribute, fellows) { let fellowsGroup = {}; fellows.forEach(fellow => { - let attr = fellow[attribute].toLowerCase(); + let attr = fellow[attribute]; if (!attr) { return; } + attr = attr.toLowerCase(); + if (!fellowsGroup[attr]) { fellowsGroup[attr] = [fellow]; } else { @@ -98,7 +98,7 @@ function renderFellowsOnDirectoryPage() { ReactDOM.render(