Skip to content

Commit 8b90ea4

Browse files
committed
Fix
1 parent bc9e695 commit 8b90ea4

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/python/add_update_member.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,8 @@ def merge_profile_data(old_profile: Dict, new_profile: Dict) -> Dict:
108108

109109
# Update current role if provided
110110
if "current_role" in new_profile:
111-
# Preserve existing fields that aren't being updated
112-
if "current_role" in merged:
113-
existing_role = merged["current_role"]
114-
new_role = new_profile["current_role"]
111+
merged["current_role"] = new_profile["current_role"]
115112

116-
# Update each field only if it exists in the new data
117-
for field in ["type", "title", "start_date", "advisor", "affiliation", "research_directions"]:
118-
if field in new_role:
119-
existing_role[field] = new_role[field]
120-
else:
121-
merged["current_role"] = new_profile["current_role"]
122-
123113
# Handle past roles
124114
if "past_roles" in new_profile:
125115
existing_past_roles = merged.get("past_roles", [])

tests/test_add_update_member.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def test_add_member(self):
5252
self.assertEqual(output, expected)
5353

5454
def test_update_member(self):
55+
self.maxDiff = None
5556
with open("tests/data/update_member/in.md") as f:
5657
issue_body = f.read()
5758

@@ -71,6 +72,9 @@ def test_update_member(self):
7172
expected = {k: expected[k] for k in sorted(expected)}
7273

7374
error_message = f"\n\n!!! Expected content of generated file to match content of file {exp_out_path}, but they did not match !!!"
75+
76+
print(output)
77+
print(expected)
7478
self.assertEqual(output, expected, error_message)
7579

7680

0 commit comments

Comments
 (0)