@@ 107,21 107,18 @@ func (s *Service) InvalidDomain(c echo.Context) error {
sq.Eq{"d.lookup_name": d},
sq.Eq{"d.is_active": false},
},
+ Limit: 1,
}
domains, err := models.GetDomains(c.Request().Context(), opts)
if err != nil {
return err
}
- if len(domains) != 1 {
- pd.Data["msg"] = lt.Translate("The %s domain is invalid", d)
- return gctx.Render(http.StatusOK, "inactive_domain.html", gmap)
+ if len(domains) == 0 {
+ // NOTE Should not happens, but just in case
+ return echo.NotFoundHandler(c)
}
- domain := domains[0]
pd.Data["msg"] = lt.Translate("The %s domain is currently inactive", d)
pd.Data["please_upgrade"] = lt.Translate("Please upgrade your account to reactivate it")
- if domain.OrgSlug.Valid {
- gmap["orgSlug"] = domain.OrgSlug.String
- }
return gctx.Render(http.StatusOK, "inactive_domain.html", gmap)
}
@@ 4,8 4,6 @@
</section>
<section class="card shadow-card">
<p class="text-center">{{.pd.Data.msg}}</p>
- {{ if .orgSlug }}
- <p class="text-center"><a href={{reverse "billing:create_subscription" .orgSlug}}>{{.pd.Data.please_upgrade}}</a></p>
- {{end}}
+ <p class="text-center"><a href={{reverse "core:org_list"}}>{{.pd.Data.please_upgrade}}</a></p>
</section>
{{template "base_footer" .}}