Issue
The GO personnel endpoint is returning blank/null values for the gender field, even though gender/sex data exists in the underlying Molnix/RRMS deployment detail payload.
Endpoint affected:
https://goadmin.ifrc.org/api/v2/personnel/
The issue appears to be in the Molnix sync code. The sync reads gender from:
but md usually comes from the deployment list payload returned by molnix.get_deployments(). That list payload includes basic person fields such as fullname, but usually does not include sex.
The full deployment detail endpoint does include person.sex, but the current code only fetches full deployment detail when position_id is missing. Since most deployment list records already have position_id, the detail fetch is skipped and personnel.gender is saved as None.
Incorrect code pattern:
if "position_id" not in md:
md2 = molnix_api.get_deployment(md["id"])
md |= md2["deployment"]
gender = None
try:
if md["person"] and "sex" in md["person"]:
gender = md["person"]["sex"]
except Exception:
warning = "Did not find gender info in %d" % md["id"]
logger.warning(warning)
warnings.append(warning)
continue
Suggested correction:
person = md.get("person") or {}
# The deployment list payload usually has person.fullname but not person.sex.
# Fetch full deployment detail when person.sex is missing.
if "position_id" not in md or "sex" not in person:
md2 = molnix_api.get_deployment(md["id"])
md.update(md2.get("deployment") or {})
person = md.get("person") or {}
gender = person.get("sex") or None
Then continue to save:
personnel.gender = gender
Also recommended:
personnel.name = person.get("fullname")
instead of:
personnel.name = md["person"]["fullname"]
Missing gender should not skip the whole personnel record. The record should still be saved with gender = None.
Steps to reproduce
- Call the GO personnel endpoint:
GET https://goadmin.ifrc.org/api/v2/personnel/
-
Inspect returned personnel records.
-
Observe that the gender field is blank/null across records.
-
Compare against Molnix/RRMS deployment detail for a personnel record’s molnix_id:
GET /api/api/deployments/{personnel.molnix_id}
- The detailed deployment payload includes:
- The deployment list payload used by the sync generally does not include
person.sex.
Expected behaviour
The GO personnel.gender field should be populated from Molnix/RRMS:
when that value exists.
If person.sex is missing or blank, the personnel record should still be imported, with gender = null.
Related feature
Molnix/RRMS sync into GO personnel records.
Relevant area:
sync_molnix
sync_deployments()
Personnel.gender
/api/v2/personnel/
Impact
This affects users consuming the GO personnel endpoint, especially the new and old Surge Dashboard
It affects Power BI reporting and any analysis based on:
Severity
Functional reporting impact.
The personnel records are imported, but gender-based analysis is incomplete or impossible from the GO personnel endpoint. This affects dashboard disaggregation by gender.
Is there a workaround?
Temporary workaround: join personnel records to Molnix/RRMS deployment/person detail externally and derive gender from:
personnel.molnix_id -> /api/api/deployments/{id} -> person.sex
However, this should be fixed in the GO sync so the gender field is populated directly in /api/v2/personnel/.
Issue
The GO
personnelendpoint is returning blank/null values for thegenderfield, even though gender/sex data exists in the underlying Molnix/RRMS deployment detail payload.Endpoint affected:
The issue appears to be in the Molnix sync code. The sync reads gender from:
but
mdusually comes from the deployment list payload returned bymolnix.get_deployments(). That list payload includes basic person fields such asfullname, but usually does not includesex.The full deployment detail endpoint does include
person.sex, but the current code only fetches full deployment detail whenposition_idis missing. Since most deployment list records already haveposition_id, the detail fetch is skipped andpersonnel.genderis saved asNone.Incorrect code pattern:
Suggested correction:
Then continue to save:
Also recommended:
instead of:
Missing gender should not skip the whole personnel record. The record should still be saved with
gender = None.Steps to reproduce
Inspect returned personnel records.
Observe that the
genderfield is blank/null across records.Compare against Molnix/RRMS deployment detail for a personnel record’s
molnix_id:person.sex.Expected behaviour
The GO
personnel.genderfield should be populated from Molnix/RRMS:when that value exists.
If
person.sexis missing or blank, the personnel record should still be imported, withgender = null.Related feature
Molnix/RRMS sync into GO personnel records.
Relevant area:
Impact
This affects users consuming the GO
personnelendpoint, especially the new and old Surge DashboardIt affects Power BI reporting and any analysis based on:
Severity
Functional reporting impact.
The personnel records are imported, but gender-based analysis is incomplete or impossible from the GO personnel endpoint. This affects dashboard disaggregation by gender.
Is there a workaround?
Temporary workaround: join personnel records to Molnix/RRMS deployment/person detail externally and derive gender from:
However, this should be fixed in the GO sync so the
genderfield is populated directly in/api/v2/personnel/.