2 Commits b2f35d181c ... 99d14fcd6e

Author SHA1 Message Date
  Maarten van den Berg 99d14fcd6e routes.aardbei: Fix crash in aardbei_apply 4 years ago
  Maarten van den Berg 7a1a003531 aardbei_sync: Actually use passed endpoint, log connection errors 4 years ago
2 changed files with 5 additions and 4 deletions
  1. 3 2
      piket_server/aardbei_sync.py
  2. 2 2
      piket_server/routes/aardbei.py

+ 3 - 2
piket_server/aardbei_sync.py

426
     AardbeiPerson objects. Return a AardbeiSyncError if something fails."""
426
     AardbeiPerson objects. Return a AardbeiSyncError if something fails."""
427
     try:
427
     try:
428
         resp: requests.Response = requests.get(
428
         resp: requests.Response = requests.get(
429
-            f"{AARDBEI_ENDPOINT}/api/groups/0/",
429
+            f"{endpoint}/api/groups/0/",
430
             headers={"Authorization": f"Group {token}"},
430
             headers={"Authorization": f"Group {token}"},
431
         )
431
         )
432
         resp.raise_for_status()
432
         resp.raise_for_status()
433
 
433
 
434
-    except requests.ConnectionError:
434
+    except requests.ConnectionError as e:
435
+        log.exception("Can't connect to endpoint %s", endpoint)
435
         return AardbeiSyncError.CantConnect
436
         return AardbeiSyncError.CantConnect
436
 
437
 
437
     except requests.HTTPError:
438
     except requests.HTTPError:

+ 2 - 2
piket_server/routes/aardbei.py

76
         {
76
         {
77
             "num_changes": link.num_changes,
77
             "num_changes": link.num_changes,
78
             "new_people": [member.person.full_name for member in link.remote_only],
78
             "new_people": [member.person.full_name for member in link.remote_only],
79
-            "link_existing": [match.local.name for match in link.matches],
80
-            "altered_name": [match.local.name for match in link.matches],
79
+            "link_existing": [match.local.full_name for match in link.matches],
80
+            "altered_name": [match.local.full_name for match in link.altered_name],
81
         },
81
         },
82
         200,
82
         200,
83
     )
83
     )