From decc34bf6e31d2c963e97fb31d690623daf77aef Mon Sep 17 00:00:00 2001 From: wes Date: Tue, 17 Jan 2017 19:02:18 -0500 Subject: [PATCH] remove old function that was used when results were on a separate page --- Makefile | 2 +- src/search.py | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Makefile b/Makefile index e491793..887c118 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ default: cp -r ./src/styles/* ./build/styles/; node-sass ./build/styles/search.scss > ./build/styles/search.min.css; cp -r ./src/templates/search.html ./build/templates/; - cp -r ./src/{archive.py,openlibrary.py,predictions.py,search.py,website.py,textbookExceptions.py} ./build/; + cp -r ./src/{archive.py,openlibrary.py,search.py,website.py,textbookExceptions.py} ./build/; cp ./src/appconfig ./build/; sed -i s,NAME_HERE,"$(SRV_NAME)",g ./build/appconfig; sed -i s,ROOT_HERE,"$(SRV_PREFIX)",g ./build/appconfig; diff --git a/src/search.py b/src/search.py index a18bef9..05ac9af 100755 --- a/src/search.py +++ b/src/search.py @@ -38,15 +38,6 @@ def classToJSON(clss): "books" : list(clss.books) if clss.books else [] } - -def truncate(docid): - """ - Truncate a document id to 12 digits - The document ID should be based on a - hash of unique identifiers - """ - return int(str(docid)[0:12]) - def hashsec(course): """ Hash a course into a usable id @@ -187,9 +178,6 @@ def search_courses(terms): ] results = [] for obj, secs in filtered: - # Add the truncated course id - # This is used to point to the resource page for that course - secs["id"] = truncate(obj.meta.id) secs["title"] = obj.title if obj["dept"] not in secs["title"]: secs["dept"] = obj.dept