Skip to content

Commit

Permalink
Fixes #109.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Rabotin committed Aug 11, 2015
1 parent 25e2d01 commit 6783a44
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bungiesearch/management/commands/search_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,17 @@ def handle(self, *args, **options):
print('Continuing.')

else:
if options['index']:
indices = options['index']
else:
indices = src.get_indices()
if options['models']:
logging.info('Updating models {}.'.format(options['models']))
model_names = options['models'].split(',')
elif options['index']:
index = options['index']
logging.info('Updating all models on index {}.'.format(options['index']))
model_names = src.get_models(index)
else:
model_names = [model for index in src.get_indices() for model in src.get_models(index)]
model_names = [model for index in indices for model in src.get_models(index)]

logging.info('Updating models {} on indices {}.'.format(model_names, indices))

# Update index.
for model_name in model_names:
if src.get_model_index(model_name).indexing_query is not None:
Expand Down

0 comments on commit 6783a44

Please sign in to comment.