Permalink
Browse files

redirect simpler in course views

  • Loading branch information...
1 parent eda3e5f commit 3c512a19178612aeae32ba7574cd407268cefd9b @ngokevin ngokevin committed Jun 5, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 course/views.py
View
@@ -36,8 +36,7 @@ def show(request, department, number, status=''):
regerror = 1
# to come back when redirecting to a different view func
- request.session['department'] = department
- request.session['number'] = number
+ request.session['prevcourse'] = department+number
courses = regclass.class_search(department, number)
if courses is None:
@@ -60,6 +59,6 @@ def register(request, crn1, crn2=""):
error = regclass.add_class(crn1, crn2)
if error:
- return HttpResponseRedirect('/course/' + request.session['department'] + request.session['number'] + '?status=error')
- return HttpResponseRedirect('/course/' + request.session['department'] + request.session['number'] + '?status=success')
+ return HttpResponseRedirect('/course/' + request.session['prevcourse'] + '?status=error')
+ return HttpResponseRedirect('/course/' + request.session['prevcourse'] + '?status=success')

0 comments on commit 3c512a1

Please sign in to comment.