Skip to content

Commit

Permalink
research_protocol_config
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 26, 2024
1 parent baee5ef commit b671627
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions edc_registration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.apps import apps as django_apps
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from edc_protocol import Protocol
from edc_protocol.research_protocol_config import ResearchProtocolConfig

from .exceptions import RegisteredSubjectError

Expand Down Expand Up @@ -53,12 +53,12 @@ def get_registered_subject(
def valid_subject_identifier_or_raise(
subject_identifier: str, raise_exception: bool | None = None
) -> bool:
if not re.match(Protocol().subject_identifier_pattern, subject_identifier):
if not re.match(ResearchProtocolConfig().subject_identifier_pattern, subject_identifier):
if raise_exception:
raise RegisteredSubjectError(
f"Invalid subject identifier format. "
f"Valid pattern is `{Protocol().subject_identifier_pattern}`. "
f"See `edc_protocol.Protocol().subject_identifier_pattern`. "
f"Valid pattern is `{ResearchProtocolConfig().subject_identifier_pattern}`. "
f"See `edc_protocol.ResearchProtocolConfig().subject_identifier_pattern`. "
f"Got `{subject_identifier}`."
)
else:
Expand Down

0 comments on commit b671627

Please sign in to comment.