Fix MustGet calls from when Globalid was not required.
This commit is contained in:
parent
c6b048d0cb
commit
2e74f95e8c
2 changed files with 48 additions and 48 deletions
4
html.go
4
html.go
|
|
@ -766,7 +766,7 @@ func trapsBySource(ctx context.Context, org *models.Organization, sourceID uuid.
|
|||
location_ids := make([]uuid.UUID, 0)
|
||||
var args []bob.Expression
|
||||
for _, location := range locations {
|
||||
location_ids = append(location_ids, location.TrapLocationGlobalid.MustGet())
|
||||
location_ids = append(location_ids, location.TrapLocationGlobalid)
|
||||
args = append(args, psql.Arg(location.TrapLocationGlobalid))
|
||||
}
|
||||
/*
|
||||
|
|
@ -944,7 +944,7 @@ func breedingSourcesByCell(ctx context.Context, org *models.Organization, c h3.C
|
|||
last_treat_date = &l
|
||||
}
|
||||
results = append(results, BreedingSourceSummary{
|
||||
ID: r.Globalid.MustGet(),
|
||||
ID: r.Globalid,
|
||||
LastInspected: last_inspected,
|
||||
LastTreated: last_treat_date,
|
||||
Type: r.Habitat.GetOr("none"),
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ func toTemplateTraps(locations []sql.TrapLocationBySourceIDRow, trap_data []sql.
|
|||
results := make([]TrapNearby, 0)
|
||||
count_by_trap_data_id := make(map[uuid.UUID]*sql.TrapCountByLocationIDRow)
|
||||
for _, c := range counts {
|
||||
count_by_trap_data_id[c.TrapdataGlobalid.MustGet()] = &c
|
||||
count_by_trap_data_id[c.TrapdataGlobalid] = &c
|
||||
}
|
||||
counts_by_location_id := make(map[uuid.UUID][]*TrapCount)
|
||||
for _, td := range trap_data {
|
||||
|
|
@ -193,14 +193,14 @@ func toTemplateTraps(locations []sql.TrapLocationBySourceIDRow, trap_data []sql.
|
|||
counts_by_location_id[loc_id] = counts
|
||||
}
|
||||
for _, location := range locations {
|
||||
counts, ok := counts_by_location_id[location.TrapLocationGlobalid.MustGet()]
|
||||
counts, ok := counts_by_location_id[location.TrapLocationGlobalid]
|
||||
if !ok {
|
||||
return results, errors.New(fmt.Sprintf("Failed to find counts for %s", location.TrapLocationGlobalid))
|
||||
}
|
||||
trap := TrapNearby{
|
||||
Counts: counts,
|
||||
Distance: location.Distance,
|
||||
ID: location.TrapLocationGlobalid.MustGet(),
|
||||
ID: location.TrapLocationGlobalid,
|
||||
}
|
||||
results = append(results, trap)
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ func toTemplateTrapData(trap_data models.FieldseekerTrapdatumSlice) ([]TrapData,
|
|||
// Basic Identifiers
|
||||
OrganizationID: r.OrganizationID,
|
||||
ObjectID: r.Objectid,
|
||||
GlobalID: r.Globalid.MustGet(),
|
||||
GlobalID: r.Globalid,
|
||||
LocationName: r.Locationname.GetOr(""),
|
||||
LocationID: r.LocID.GetOr(uuid.UUID{}),
|
||||
SRID: r.Srid.GetOr(uuid.UUID{}),
|
||||
|
|
@ -343,7 +343,7 @@ func toTemplateBreedingSource(source *models.FieldseekerPointlocation) *Breeding
|
|||
Description: source.Description.MustGet(),
|
||||
LocationNumber: int64(source.Locationnumber.GetOr(0)),
|
||||
ObjectID: source.Objectid,
|
||||
GlobalID: source.Globalid.MustGet(),
|
||||
GlobalID: source.Globalid,
|
||||
ExternalID: source.Externalid.GetOr(""),
|
||||
|
||||
// Status Information
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue