Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
Merge branch '960/empty-index-settings'
Browse files Browse the repository at this point in the history
  • Loading branch information
brew committed Mar 20, 2017
2 parents 5b3faff + 2e194d2 commit 08baa94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion census/views/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2>{{ gettext('Data actions') }}</h2>
<li><form action="/admin/load/places" method="post"><button class="btn btn-primary" type="submit">{{ gettext('Reload Places') }}</button></form></li>
<li><form action="/admin/load/datasets" method="post"><button class="btn btn-primary" type="submit">{{ gettext('Reload Datasets (& QuestionSets)') }}</button></form></li>
<li><form action="/admin/load/questionsets" method="post"><button class="btn btn-primary" type="submit">{{ gettext('Reload QuestionSets') }}</button></form></li>
<li><form action="/admin/buildindex" method="post"><button class="btn btn-primary" type="submit" {% if not site.indexSettings %}disabled{% endif %}>{{ gettext('Build Index Website') }}</button> {% if not site.indexSettings %}(No Index Settings for site){% endif %}</form></li>
<li><form action="/admin/buildindex" method="post"><button class="btn btn-primary" type="submit" {% if not site.indexSettings|length %}disabled{% endif %}>{{ gettext('Build Index Website') }}</button> {% if not site.indexSettings|length %}(No Index Settings for site){% endif %}</form></li>
</ul>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions index/metalsmith-godi-getdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ function plugin(options) {
.then(site => {
// Validate that there's a site and site.indexSettings
if (site) {
if (_.get(site, 'indexSettings')) {
return modelUtils.getData(defaultOptions);
} else {
if (_.isEmpty(_.get(site, 'indexSettings'))) {
throw new Error(`Can't generate Index. Site '${options.domain}' has no index settings.`);
} else {
return modelUtils.getData(defaultOptions);
}
} else {
throw new Error(`Can't generate Index. Site '${options.domain}' does not exist.`);
Expand Down

0 comments on commit 08baa94

Please sign in to comment.