Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(MM): Add reason on history for add in m2m relationship #716

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def load_metadata_csv(df: pd.DataFrame, is_emit_eb_events: bool = True, user_id:
try:
subject.individual_set.get(orcabus_id=idv.orcabus_id)
except ObjectDoesNotExist:
subject._change_reason = reason
subject.individual_set.add(idv)

# We update the stats when new idv is linked to sbj, only if this is not recorded as
Expand Down Expand Up @@ -182,6 +183,7 @@ def load_metadata_csv(df: pd.DataFrame, is_emit_eb_events: bool = True, user_id:
try:
project.contact_set.get(orcabus_id=contact.orcabus_id)
except ObjectDoesNotExist:
project._change_reason = reason
project.contact_set.add(contact)

# We update the stats when new ctc is linked to prj, only if this is not recorded as
Expand Down Expand Up @@ -236,8 +238,8 @@ def load_metadata_csv(df: pd.DataFrame, is_emit_eb_events: bool = True, user_id:
try:
library.project_set.get(orcabus_id=project.orcabus_id)
except ObjectDoesNotExist:
library._change_reason = reason
library.project_set.add(project)

# We update the stats when new project is linked to library, only if this is not recorded as
# update/create in previous upsert method
if not is_lib_created and not is_lib_updated:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def persist_lab_metadata(df: pd.DataFrame, sheet_year: str, is_emit_eb_events: b
try:
subject.individual_set.get(orcabus_id=idv.orcabus_id)
except ObjectDoesNotExist:
subject._change_reason = reason
subject.individual_set.add(idv)

# We update the stats when new idv is linked to sbj, only if this is not recorded as
Expand Down Expand Up @@ -192,6 +193,7 @@ def persist_lab_metadata(df: pd.DataFrame, sheet_year: str, is_emit_eb_events: b
try:
project.contact_set.get(orcabus_id=contact.orcabus_id)
except ObjectDoesNotExist:
project._change_reason = reason
project.contact_set.add(contact)

# We update the stats when new ctc is linked to prj, only if this is not recorded as
Expand Down Expand Up @@ -247,6 +249,7 @@ def persist_lab_metadata(df: pd.DataFrame, sheet_year: str, is_emit_eb_events: b
try:
library.project_set.get(orcabus_id=project.orcabus_id)
except ObjectDoesNotExist:
library._change_reason = reason
library.project_set.add(project)

# We update the stats when new project is linked to library, only if this is not recorded as
Expand Down