mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-03-16 22:00:22 +00:00
fixing args handling in buildwatson
This commit is contained in:
parent
a0372683a1
commit
6519e364cf
1 changed files with 7 additions and 1 deletions
|
|
@ -79,10 +79,16 @@ class Command(BaseCommand):
|
|||
engine_slug = "default"
|
||||
engine_selected = False
|
||||
|
||||
# work-around for legacy optparser hack in BaseCommand. In Django=1.10 the
|
||||
# args are collected in options['apps'], but in earlier versions they are
|
||||
# kept in args.
|
||||
if len(options['apps']):
|
||||
args = options['apps']
|
||||
|
||||
# get the search engine we'll be checking registered models for, may be "default"
|
||||
search_engine = get_engine(engine_slug)
|
||||
models = []
|
||||
for model_name in options.get('apps', []):
|
||||
for model_name in args:
|
||||
try:
|
||||
model = apps.get_model(*model_name.split(".")) # app label, model name
|
||||
except TypeError: # were we given only model name without app_name?
|
||||
|
|
|
|||
Loading…
Reference in a new issue