Backend: Code clean-up

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-04-26 17:15:17 +02:00
parent 404682b730
commit 95cc4ec43f
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ func TestNewLens(t *testing.T) {
lens := NewLens("", "")
assert.Equal(t, "Unknown", lens.LensModel)
assert.Equal(t, "", lens.LensMake)
assert.Equal(t, "zz", lens.LensSlug)
assert.Equal(t, UnknownLens.LensSlug, lens.LensSlug)
assert.Equal(t, &UnknownLens, lens)
})
}

View file

@ -88,7 +88,7 @@ func (m *Photo) UpdateLocation(db *gorm.DB, geoApi string) (keywords []string, l
m.PlaceID = UnknownPlace.ID
}
if m.Place != nil && (m.PhotoCountry == "" || m.PhotoCountry == "zz") {
if m.Place != nil && (m.PhotoCountry == "" || m.PhotoCountry == UnknownCountry.Code()) {
m.PhotoCountry = m.Place.LocCountry
}