Exclude opt-in campaign from public archive.
This commit is contained in:
parent
23fb178ec4
commit
eac1240437
1 changed files with 10 additions and 3 deletions
|
@ -77,12 +77,19 @@ func handleCampaignArchivePage(c echo.Context) error {
|
||||||
)
|
)
|
||||||
|
|
||||||
pubCamp, err := app.core.GetArchivedCampaign(0, uuid)
|
pubCamp, err := app.core.GetArchivedCampaign(0, uuid)
|
||||||
if err != nil {
|
if err != nil || pubCamp.Type != models.CampaignTypeRegular {
|
||||||
|
notFound := false
|
||||||
if er, ok := err.(*echo.HTTPError); ok {
|
if er, ok := err.(*echo.HTTPError); ok {
|
||||||
if er.Code == http.StatusBadRequest {
|
if er.Code == http.StatusBadRequest {
|
||||||
return c.Render(http.StatusNotFound, tplMessage,
|
notFound = true
|
||||||
makeMsgTpl(app.i18n.T("public.notFoundTitle"), "", app.i18n.T("public.campaignNotFound")))
|
|
||||||
}
|
}
|
||||||
|
} else if pubCamp.Type != models.CampaignTypeRegular {
|
||||||
|
notFound = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if notFound {
|
||||||
|
return c.Render(http.StatusNotFound, tplMessage,
|
||||||
|
makeMsgTpl(app.i18n.T("public.notFoundTitle"), "", app.i18n.T("public.campaignNotFound")))
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.Render(http.StatusInternalServerError, tplMessage,
|
return c.Render(http.StatusInternalServerError, tplMessage,
|
||||||
|
|
Loading…
Reference in a new issue