Skip to content
Permalink
Browse files

Autofix search issue where course subject and number are not in the p…

…roper format
  • Loading branch information...
gravitylow committed Jan 19, 2016
1 parent 85f3e7e commit 86680fed4e03bf82ada72bf94d80d4f78a7bcbb6
Showing with 4 additions and 0 deletions.
  1. +4 −0 course/views.py
@@ -12,6 +12,7 @@
from django.contrib.auth.decorators import login_required
from tastypie.models import ApiKey
from collections import OrderedDict
import re

def search(request):
term = None
@@ -52,6 +53,9 @@ def search(request):
query = query.filter(crn=crn)
log['crn'] = str(crn)
if course:
match = re.search(r'([A-z]+?)([0-9]+)', course)
if match:
course = match.group(1) + ' ' + match.group(2)
query = query.filter(course__icontains=course)
log['course'] = course
if days:

0 comments on commit 86680fe

Please sign in to comment.
You can’t perform that action at this time.