diff --git a/pkg/home/public.go b/pkg/home/public.go index a9c1807..57c1077 100644 --- a/pkg/home/public.go +++ b/pkg/home/public.go @@ -53,7 +53,11 @@ func (p *homePage) MustRender(w http.ResponseWriter, r *http.Request, user *auth p.CampsiteTypes = mustCollectCampsiteTypes(r.Context(), company, conn, user.Locale) p.Cover = carousel.MustCollectSlides(r.Context(), company, conn, user.Locale, coverName) p.Carousel = carousel.MustCollectSlides(r.Context(), company, conn, user.Locale, carouselName) - p.Slogan = conn.MustGetText(r.Context(), "select coalesce(i18n.slogan, home.slogan) from home left join camper.home_i18n as i18n on i18n.company_id = home.company_id and i18n.lang_tag = $1 where home.company_id = $2", user.Locale.Language, company.ID) + var err error + p.Slogan, err = conn.GetText(r.Context(), "select coalesce(i18n.slogan, home.slogan) from home left join camper.home_i18n as i18n on i18n.company_id = home.company_id and i18n.lang_tag = $1 where home.company_id = $2", user.Locale.Language, company.ID) + if err != nil && !database.ErrorIsNotFound(err) { + panic(err) + } template.MustRenderPublic(w, r, user, company, "home.gohtml", p) }