diff --git a/webapp/api/api/apps.py b/webapp/api/api/apps.py index 997dfac9..022518c2 100644 --- a/webapp/api/api/apps.py +++ b/webapp/api/api/apps.py @@ -12,8 +12,8 @@ class ApiConfig(AppConfig): def ready(self): from api.views import _submit_document from api.models import ProjectAnnotateEntities - resubmit_all = os.environ.get('RESUBMIT_ALL_ON_STARTUP', False) - if resubmit_all: + resubmit_all = os.environ.get('RESUBMIT_ALL_ON_STARTUP', None) + if resubmit_all is not None and resubmit_all.lower() in ('1', 'y', 'true'): logger.info('Found env var RESUBMIT_ALL_ON_STARTUP is True. ' 'Attempting to resubmit all currently submitted state documents') projects = ProjectAnnotateEntities.objects.all() diff --git a/webapp/frontend/src/views/Home.vue b/webapp/frontend/src/views/Home.vue index 0775fa22..28496155 100644 --- a/webapp/frontend/src/views/Home.vue +++ b/webapp/frontend/src/views/Home.vue @@ -243,9 +243,7 @@ export default { if (resp.data.next) { this.fetchPage(resp.data.next) } else { - this.fetchCDBsLoaded() - this.fetchSearchIndexStatus() - this.loadingProjects = false + this.postLoadedProjects() } }).catch(() => { this.$cookie.delete('username') @@ -263,10 +261,15 @@ export default { if (resp.data.next) { this.fetchPage(resp.data.next) } else { - this.fetchCDBsLoaded() + this.postLoadedProjects() } }) }, + postLoadedProjects () { + this.fetchCDBsLoaded() + this.fetchSearchIndexStatus() + this.loadingProjects = false + }, fetchCDBsLoaded () { this.$http.get('/api/model-loaded/').then(resp => { this.cdbLoaded = resp.data