| Server IP : 216.92.14.13 / Your IP : 216.73.217.126 Web Server : Apache System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : rmlac2fmr ( 1040637) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/home/rmlac2fmr/ |
Upload File : |
import json
db = json.load(open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json"))
real_id = "P97665868pvfh0"
dupe_id = "P46503878"
nmdc_req_id = "R1776046503878"
# Relink NMDC request to real profile
r = next((r for r in db["travelRequests"] if r["id"] == nmdc_req_id), None)
if r:
print(f"Relinking {nmdc_req_id}: {r['personId']} -> {real_id}")
r["personId"] = real_id
# Relink any hotel bookings, perdiems, etc
for h in db.get("hotelBookings", []):
if h.get("personId") == dupe_id:
print(f" Relinking hotel booking {h['id']}")
h["personId"] = real_id
for pd in db.get("perDiems", []):
if pd.get("personId") == dupe_id:
print(f" Relinking per diem {pd['id']}")
pd["personId"] = real_id
# Remove duplicate profile
db["persons"] = [p for p in db["persons"] if p["id"] != dupe_id]
print(f"Removed duplicate profile {dupe_id}")
# Remove duplicate's assignments (real profile already has S2)
db["assignments"] = [a for a in db["assignments"] if a.get("personId") != dupe_id]
print(f"Removed duplicate assignments")
# Verify
real = next((p for p in db["persons"] if p["id"] == real_id), None)
reqs = [r for r in db["travelRequests"] if r.get("personId") == real_id]
print(f"\nVerification:")
print(f" {real['firstName']} {real['lastName']} ({real_id})")
print(f" Email: {real.get('email','')}")
print(f" Travel requests: {len(reqs)}")
for r in reqs:
print(f" {r['id']} showId={r['showId']} depDate={r.get('depDate','')} retDate={r.get('retDate','')}")
json.dump(db, open("/home/rmlac2fmr/public_html/jn.com/ops/data/db.json", "w"), indent=2)
print("\nDone!")