Skip to content

Commit

Permalink
Merge branch 'release/0.3.83' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Apr 18, 2024
2 parents ecf16e9 + 0a240b4 commit 249ba60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion edc_consent/site_consents.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.apps import apps as django_apps
from django.core.management.color import color_style
from django.utils.module_loading import import_module, module_has_submodule
from edc_sites.site import sites as site_sites
from edc_utils import ceil_secs, floor_secs, formatted_date

from .exceptions import (
Expand Down Expand Up @@ -98,7 +99,11 @@ def validate_period_overlap_or_raise(self, cdef: ConsentDefinition):

def get_consents(self, subject_identifier: str, site_id: int | None) -> list:
consents = []
for cdef in self.all():
opts = {}
if site_id:
single_site = site_sites.get(site_id)
opts.update(site=single_site)
for cdef in self.get_consent_definitions(**opts):
if consent_obj := cdef.get_consent_for(
subject_identifier=subject_identifier,
site_id=site_id,
Expand Down

0 comments on commit 249ba60

Please sign in to comment.