Skip to content

Commit 073f5f6

Browse files
committed
Actually implement isCompleted for class change request
1 parent 8cc5ed7 commit 073f5f6

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

esp/esp/program/modules/handlers/classchangerequestmodule.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from datetime import datetime
3636
from urllib import quote
3737

38+
from esp.middleware.threadlocalrequest import get_current_request
3839
from esp.program.models import Program, StudentAppResponse, StudentRegistration, RegistrationType
3940
from esp.program.models.class_ import ClassSubject
4041
from esp.program.modules.base import ProgramModuleObj
@@ -63,17 +64,9 @@ def module_properties(cls):
6364
class Meta:
6465
proxy = True
6566

66-
def is_completed(self):
67-
return True
68-
69-
def students(self, QObject=False):
70-
if QObject:
71-
return {}
72-
else:
73-
return {}
74-
75-
def studentDesc(self):
76-
return {}
67+
def isCompleted(self):
68+
return StudentRegistration.valid_objects().filter(user=get_current_request().user,
69+
relationship__name="Request").exists()
7770

7871
@main_call
7972
@needs_student

0 commit comments

Comments
 (0)