Skip to content

Commit

Permalink
Fix module 2 completion error
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoest committed Jan 11, 2025
1 parent 867af85 commit 829c663
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions S1/waitinglists/management/commands/module_cleanup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.utils import timezone
from waitinglists.models import Module, QuizCompletion, WaitingList
from waitinglists.views import module_2_completion
from django.contrib.auth.models import User

import os
from dotenv import load_dotenv


class Command(BaseCommand):
Expand Down
4 changes: 1 addition & 3 deletions S1/waitinglists/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from datetime import datetime
from pathlib import Path

import requests
from django.contrib.auth.decorators import login_required, user_passes_test
from django.forms import modelformset_factory
from django.http import HttpResponse, HttpResponseRedirect
Expand Down Expand Up @@ -53,11 +52,10 @@ def module_2_completion(user, fetch=False):
else:
array[name] = [None, False]

return array, len(array) == len(quiz_ids)
return array, len([val for val in array.values() if val[1] == True])


def check_modules(user):
# TODO: check if this is using the correct user ID
try:
mod3 = Module.objects.get(name="Module 3")
mod4 = Module.objects.get(name="Module 4")
Expand Down

0 comments on commit 829c663

Please sign in to comment.