Skip to content

Commit

Permalink
show consents on dashboard even if off study
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Apr 24, 2024
1 parent 249ba60 commit 3860f02
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions edc_consent/view_mixins/consent_view_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ def __init__(self, **kwargs):
super().__init__(**kwargs)

def get_context_data(self, **kwargs) -> dict[str, Any]:
"""Add consent to the dashboard only if subject
is still on a schedule.
"""
"""Add consent_definition and consents to the dashboard."""
# TODO: What if active on more than one schedule??
if self.current_schedule:
try:
kwargs.update(consent_definition=self.consent_definition)
except ConsentDefinitionDoesNotExist as e:
messages.add_message(self.request, message=str(e), level=ERROR)
else:
kwargs.update(consent=self.consent, consents=self.consents)
try:
kwargs.update(consent_definition=self.consent_definition)
except ConsentDefinitionDoesNotExist as e:
messages.add_message(self.request, message=str(e), level=ERROR)
else:
kwargs.update(consent=self.consent, consents=self.consents)
return super().get_context_data(**kwargs)

@property
Expand Down

0 comments on commit 3860f02

Please sign in to comment.