Skip to content

Commit

Permalink
feincms3-data 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Mar 15, 2023
1 parent 026bb08 commit b8ff09a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Change log

.. _Next version: https://github.com/matthiask/feincms3-data/compare/0.5...main

- Fixed the broken argument validation of ``./manage.py f3dumpdata``.


`0.5`_ (2023-03-15)
~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion feincms3_data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = (0, 5, 0)
VERSION = (0, 5, 1)
__version__ = ".".join(map(str, VERSION))
10 changes: 7 additions & 3 deletions feincms3_data/management/commands/f3dumpdata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.core.management.base import BaseCommand
from django.core.management.base import BaseCommand, CommandError

from feincms3_data.data import datasets, dump_specs

Expand All @@ -11,10 +11,14 @@ def add_arguments(self, parser):
parser.add_argument(
"dataset",
help=f"Model dataset which should be dumped. {', '.join(DATASETS)}",
choices=DATASETS,
)

def handle(self, *args, **options):
dataset, sep, args = options["dataset"].partition(":")
ds = DATASETS[dataset]
try:
ds = DATASETS[dataset]
except KeyError:
raise CommandError(
f"Invalid dataset {dataset}; should be one of {', '.join(DATASETS)}"
)
self.stdout.write(dump_specs(ds["specs"](args), mappers=ds.get("mappers")))

0 comments on commit b8ff09a

Please sign in to comment.