Skip to content

Commit

Permalink
Added the IN_PROGRESS Training Status.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutvikrj26 committed Nov 15, 2024
1 parent 337361f commit 79ff4a6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion physionet-django/training/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_course_and_module_progress(user, course, module_order):
user=user,
course=course,
process_datetime=timezone.now(),
status=TrainingStatus.REVIEW
status=TrainingStatus.IN_PROGRESS
)


Expand Down
1 change: 1 addition & 0 deletions physionet-django/user/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class TrainingStatus(IntEnum):
WITHDRAWN = 1
REJECTED = 2
ACCEPTED = 3
IN_PROGRESS = 4

@classmethod
def choices(cls):
Expand Down
4 changes: 2 additions & 2 deletions physionet-django/user/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def get_review(self):
| Q(training_type__required_field=RequiredField.URL)
)

def in_progress(self):
def get_in_progress(self):
"""
Get the on-platform training objects for the user, that are in the status REVIEW.
"""
return self.filter(
Q(status=TrainingStatus.REVIEW),
Q(status=TrainingStatus.IN_PROGRESS),
Q(training_type__required_field=RequiredField.PLATFORM)
)

Expand Down
4 changes: 3 additions & 1 deletion physionet-django/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,12 +824,14 @@ def edit_certification(request):
)
training_by_status = {
"under review": training.get_review(),
"in progress": training.in_progress(),
"in progress": training.get_in_progress(),
"active": training.get_valid(),
"expired": training.get_expired(),
"rejected": training.get_rejected(),
}

print(training_by_status)

return render(
request,
"user/edit_certification.html",
Expand Down

0 comments on commit 79ff4a6

Please sign in to comment.