Skip to content

Commit

Permalink
feat: get_checker_errors for SessionsChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
EdoStorm96 committed Sep 18, 2024
1 parent 83f37fa commit 3e20a88
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion proposals/utils/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,16 @@ def make_stepper_item(
stepper item be bold for all underlying task/session views.
Don't ask me how much time I spent on this.
"""
item = super().make_stepper_item()
item = ModelFormItem(
self.stepper,
title=self.title,
parent=self.parent,
form_object=self.get_form_object(),
form_class=self.form_class,
form_kwargs=self.get_form_kwargs(),
url_func=self.get_url,
error_func = self.get_checker_errors
)

def modified_is_current(self, request):
if request.path_info == self.get_url():
Expand Down Expand Up @@ -752,6 +761,14 @@ def get_url(
"tasks:session_overview",
args=[self.study.pk],
)

def get_checker_errors(self):
from proposals.utils.validate_sessions_tasks import validate_sessions_tasks

if validate_sessions_tasks(self.study, self.stepper.has_multiple_studies()):
return True
return



class DocumentsChecker(
Expand Down

0 comments on commit 3e20a88

Please sign in to comment.