Skip to content

Commit

Permalink
Revert "Added 'course' to the student session"
Browse files Browse the repository at this point in the history
This reverts commit 6f22bc6.
  • Loading branch information
ramcav committed Dec 1, 2023
1 parent c2a8e7f commit 6f781b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mysite/home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class StudentDashboardView(LoginRequiredMixin, View):

def get(self, request):
context = {}

if request.user.is_authenticated:
student = get_object_or_404(Student, user = request.user)
classes = student.courses.all()
Expand All @@ -51,7 +52,6 @@ def post(self, request):
student = get_object_or_404(Student, user=request.user)
selected_class_id = request.POST.get('selected_class')
attendance_code = request.POST.get('attendance_code')
request.session["selected_class_id"] = selected_class_id

# Get the course using the selected_class_id
course = get_object_or_404(Course, id=selected_class_id)
Expand Down Expand Up @@ -147,7 +147,6 @@ class ConfirmationView(LoginRequiredMixin, View):
def get(self, request):
context = {}
class_id = request.session.get('selected_class_id')
print(class_id)
course = get_object_or_404(Course, id=class_id)
context["class"] = course.course_name
context["is_professor"] = False
Expand Down

0 comments on commit 6f781b5

Please sign in to comment.