From 5cfd16e6a0b30639f02a1a75712c3aa9acdb1f9f Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 18 Mar 2026 19:00:40 +0000 Subject: [PATCH] Fix references to report organization ID --- rmo/notification.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rmo/notification.go b/rmo/notification.go index 3cb6fdd2..1fbb8239 100644 --- a/rmo/notification.go +++ b/rmo/notification.go @@ -44,16 +44,15 @@ func postRegisterNotifications(w http.ResponseWriter, r *http.Request) { return } defer txn.Rollback(ctx) - location, err := models.PublicreportReports.Query( + rep, err := models.PublicreportReports.Query( models.SelectWhere.PublicreportReports.PublicID.EQ(report_id), ).One(ctx, db.PGInstance.BobDB) if err != nil { - log.Error().Err(err).Msg("Failed to get report location") + log.Error().Err(err).Msg("Failed to get report") http.Redirect(w, r, fmt.Sprintf("/error?code=report-location-failed&report=%s", report_id), http.StatusFound) return } - org_id := location.OrganizationID.MustGet() e := report.SaveReporter(ctx, txn, report_id, name, email, phone, has_consent) if e != nil { log.Error().Err(e).Str("name", name).Msg("Failed to save reporter") @@ -93,7 +92,7 @@ func postRegisterNotifications(w http.ResponseWriter, r *http.Request) { } } txn.Commit(ctx) - platform.PublicReportReporterUpdated(ctx, org_id, report_id) + platform.PublicReportReporterUpdated(ctx, rep.OrganizationID, report_id) http.Redirect(w, r, fmt.Sprintf("/register-notifications-complete?report=%s", report_id), http.StatusFound) }