Commit b6e67221 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed bug with missing atoms in search index.

parent b41006f6
Pipeline #46050 passed with stages
in 15 minutes and 57 seconds
...@@ -8,7 +8,7 @@ import TablePagination from '@material-ui/core/TablePagination' ...@@ -8,7 +8,7 @@ import TablePagination from '@material-ui/core/TablePagination'
import TableRow from '@material-ui/core/TableRow' import TableRow from '@material-ui/core/TableRow'
import Paper from '@material-ui/core/Paper' import Paper from '@material-ui/core/Paper'
import { TableHead, LinearProgress, FormControl, FormControlLabel, Checkbox, FormGroup, import { TableHead, LinearProgress, FormControl, FormControlLabel, Checkbox, FormGroup,
FormLabel, IconButton, MuiThemeProvider, Typography, Tooltip, TableSortLabel, ExpansionPanelDetails, ExpansionPanelSummary, ExpansionPanel, Grid, CircularProgress } from '@material-ui/core' FormLabel, IconButton, MuiThemeProvider, Typography, Tooltip, TableSortLabel, ExpansionPanelDetails, ExpansionPanelSummary, ExpansionPanel, Grid } from '@material-ui/core'
import { compose } from 'recompose' import { compose } from 'recompose'
import { withErrors } from './errors' import { withErrors } from './errors'
import AnalyticsIcon from '@material-ui/icons/Settings' import AnalyticsIcon from '@material-ui/icons/Settings'
......
...@@ -148,7 +148,13 @@ class CalcWithMetadata(): ...@@ -148,7 +148,13 @@ class CalcWithMetadata():
def update(self, **kwargs): def update(self, **kwargs):
for key, value in kwargs.items(): for key, value in kwargs.items():
if value is None:
continue
if isinstance(value, list): if isinstance(value, list):
if len(value) == 0:
continue
if len(value) > 0 and isinstance(value[0], dict) and not isinstance(value[0], utils.POPO): if len(value) > 0 and isinstance(value[0], dict) and not isinstance(value[0], utils.POPO):
value = list(utils.POPO(**item) for item in value) value = list(utils.POPO(**item) for item in value)
if isinstance(value, dict) and not isinstance(value, utils.POPO): if isinstance(value, dict) and not isinstance(value, utils.POPO):
......
...@@ -226,7 +226,7 @@ class TestUploads: ...@@ -226,7 +226,7 @@ class TestUploads:
upload_with_metadata = get_upload_with_metadata(upload) upload_with_metadata = get_upload_with_metadata(upload)
assert_upload_files(upload_with_metadata, files.StagingUploadFiles) assert_upload_files(upload_with_metadata, files.StagingUploadFiles)
assert_search_upload(upload_with_metadata) assert_search_upload(upload_with_metadata, additional_keys=['atoms', 'system'])
def assert_published(self, client, test_user_auth, upload_id, proc_infra, with_coe_repo=True, metadata={}): def assert_published(self, client, test_user_auth, upload_id, proc_infra, with_coe_repo=True, metadata={}):
rv = client.get('/uploads/%s' % upload_id, headers=test_user_auth) rv = client.get('/uploads/%s' % upload_id, headers=test_user_auth)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment