Skip to content

Commit

Permalink
Merge c37b04e into 525be0d
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed May 17, 2023
2 parents 525be0d + c37b04e commit 695173a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions fence/sync/sync_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,17 @@ def _parse_csv(self, file_dict, sess, dbgap_config={}, encrypted=True):
) as f:
csv = DictReader(f, quotechar='"', skipinitialspace=True)
for row in csv:
username = row.get("login", "")
username = row.get("login") or ""
if username == "":
continue

phsid_privileges = {}
if dbgap_config.get("allow_non_dbGaP_whitelist", False):
phsid = row.get("phsid", row.get("project_id", "")).split(".")
phsid = (
row.get("phsid") or (row.get("project_id") or "")
).split(".")
else:
phsid = row.get("phsid", "").split(".")
phsid = (row.get("phsid") or "").split(".")

dbgap_project = phsid[0]
# There are issues where dbgap has a wrong entry in their whitelist. Since we do a bulk arborist request, there are wrong entries in it that invalidates the whole request causing other correct entries not to be added
Expand Down Expand Up @@ -620,8 +622,8 @@ def _parse_csv(self, file_dict, sess, dbgap_config={}, encrypted=True):

dbgap_project += "." + consent_code

display_name = row.get("user name", "")
tags = {"dbgap_role": row.get("role", "")}
display_name = row.get("user name") or ""
tags = {"dbgap_role": row.get("role") or ""}

# some dbgap telemetry files have information about a researchers PI
if "downloader for" in row:
Expand All @@ -632,9 +634,9 @@ def _parse_csv(self, file_dict, sess, dbgap_config={}, encrypted=True):
tags["pi"] = row["downloader for names"]

user_info[username] = {
"email": row.get("email", ""),
"email": row.get("email") or "",
"display_name": display_name,
"phone_number": row.get("phone", ""),
"phone_number": row.get("phone") or "",
"tags": tags,
}

Expand Down

0 comments on commit 695173a

Please sign in to comment.