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,13 +77,20 @@ func handleCampaignArchivePage(c echo.Context) error {
|
|||
)
|
||||
|
||||
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.Code == http.StatusBadRequest {
|
||||
notFound = true
|
||||
}
|
||||
} 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,
|
||||
makeMsgTpl(app.i18n.T("public.errorTitle"), "", app.i18n.Ts("public.errorFetchingCampaign")))
|
||||
|
|
Loading…
Reference in a new issue