Skip to content

Commit

Permalink
Fix broken validation (#4168) (patch)
Browse files Browse the repository at this point in the history
### Fixed

- Region code only set by validator if region is set
- Original lab address only set by validator if original lab is set.
  • Loading branch information
islean authored Jan 29, 2025
1 parent f0899fb commit 49f9230
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MutantSample(Sample):
def set_original_lab_address(cls, data: any) -> any:
if isinstance(data, dict):
is_set = bool(data.get("original_lab_address"))
if not is_set:
if not is_set and data.get("original_lab"):
data["original_lab_address"] = ORIGINAL_LAB_ADDRESSES[data["original_lab"]]
return data

Expand All @@ -52,7 +52,7 @@ def set_original_lab_address(cls, data: any) -> any:
def set_region_code(cls, data: any) -> any:
if isinstance(data, dict):
is_set = bool(data.get("region_code"))
if not is_set:
if not is_set and data.get("region"):
data["region_code"] = REGION_CODES[data["region"]]
return data

Expand Down

0 comments on commit 49f9230

Please sign in to comment.