Skip to content

Commit

Permalink
Changing option_list for add_arguments in import_folio_mapping and re…
Browse files Browse the repository at this point in the history
…fresh_solr
  • Loading branch information
napulen committed Feb 2, 2021
1 parent 083bd37 commit 8140a43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions public/cantusdata/management/commands/import_folio_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class Command(BaseCommand):
Usage: See 'help' below
"""

option_list = BaseCommand.option_list + (
make_option(
def add_arguments(self, parser):
parser.add_argument("args", nargs=2)
parser.add_argument(
"--no-refresh",
action="store_false",
dest="refresh",
default=True,
help="Do not refresh Solr after the import",
),
)
)

help = (
"Usage: ./manage.py import_folio_mapping <manuscript_id> <mapping_csv_file> [<manuscript2_id> <mapping_csv_file2> ...]"
Expand Down
12 changes: 7 additions & 5 deletions public/cantusdata/management/commands/refresh_solr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ class Command(BaseCommand):
)
)

option_list = BaseCommand.option_list + (
make_option(
def add_arguments(self, parser):
# "args" means "compatibility mode" to process arbitrary args
parser.add_argument("args", nargs=2)

parser.add_argument(
"--all",
action="store_true",
dest="all",
default=False,
help="Refresh all types: {0}".format(list(TYPE_MAPPING.keys())),
),
)
help=f"Refresh all types: {list(self.TYPE_MAPPING.keys())}",
)

def handle(self, *args, **options):
solr_conn = solr.SolrConnection(settings.SOLR_SERVER)
Expand Down

0 comments on commit 8140a43

Please sign in to comment.