Skip to content

Commit

Permalink
Enable file for use even when not in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
EOA User committed Jun 8, 2020
1 parent 78bb924 commit 2cd26a2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/eoa/management/commands/dump_cms.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ def handle(self, *args, **options):
logger = self.init_logging(verbosity = options['verbosity'])

timestr = time.strftime("%Y%m%d-%H%M%S")
output_file = (Path(environ['RES_DIR']) / "fixtures" / timestr) . with_suffix( ".json" )

output_file.parent.mkdir(
try:
output_file = (Path(environ['RES_DIR']) / "fixtures" / timestr) . with_suffix( ".json" )
output_file.parent.mkdir(
parents = True,
exist_ok = True
)
)
except KeyError:
output_file = f"cmsdump{timestr}.json"

call_command(
"dumpdata",
Expand Down

0 comments on commit 2cd26a2

Please sign in to comment.