Fix uuidShort to handle real UUIDs now that we have them
This commit is contained in:
parent
9435af6a1f
commit
98416a025d
1 changed files with 5 additions and 4 deletions
9
html.go
9
html.go
|
|
@ -943,12 +943,13 @@ func breedingSourcesByCell(ctx context.Context, org *models.Organization, c h3.C
|
||||||
return results, nil
|
return results, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func uuidShort(uuid string) string {
|
func uuidShort(uuid uuid.UUID) string {
|
||||||
if len(uuid) < 7 {
|
s := uuid.String()
|
||||||
return uuid // Return as is if too short
|
if len(s) < 7 {
|
||||||
|
return s // Return as is if too short
|
||||||
}
|
}
|
||||||
|
|
||||||
return uuid[:3] + "..." + uuid[len(uuid)-4:]
|
return s[:3] + "..." + s[len(s)-4:]
|
||||||
}
|
}
|
||||||
|
|
||||||
func sourceByGlobalId(ctx context.Context, org *models.Organization, id uuid.UUID) (*BreedingSourceDetail, error) {
|
func sourceByGlobalId(ctx context.Context, org *models.Organization, id uuid.UUID) (*BreedingSourceDetail, error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue