Show district branding on status page

This commit is contained in:
Eli Ribble 2026-02-10 14:55:59 +00:00
parent 28ade30d2b
commit 5802fe4fd3
No known key found for this signature in database

View file

@ -112,6 +112,14 @@ func contentFromNuisance(ctx context.Context, report_id string) (result ContentS
return result, fmt.Errorf("Failed to get images %s: %w", report_id, err)
}
if !nuisance.OrganizationID.IsNull() {
org_id := nuisance.OrganizationID.MustGet()
org, err := models.FindOrganization(ctx, db.PGInstance.BobDB, org_id)
if err != nil {
return result, fmt.Errorf("Failed to get district %d information: %w", org_id, err)
}
result.District = newContentDistrict(org)
}
result.Report.ID = report_id
result.Report.Address = nuisance.Address
result.Report.Created = nuisance.Created
@ -210,6 +218,15 @@ func contentFromPool(ctx context.Context, report_id string) (result ContentStatu
return result, fmt.Errorf("Failed to get images %s: %w", report_id, err)
}
if !pool.OrganizationID.IsNull() {
org_id := pool.OrganizationID.MustGet()
org, err := models.FindOrganization(ctx, db.PGInstance.BobDB, org_id)
if err != nil {
return result, fmt.Errorf("Failed to get district %d information: %w", org_id, err)
}
result.District = newContentDistrict(org)
}
result.Report.ID = report_id
result.Report.Address = pool.Address
result.Report.Created = pool.Created