Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mhucka committed Oct 9, 2021
2 parents 7296fa6 + 35adcd7 commit 5cdbcb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion admin/export-data
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Command-line options summary
inform(f' {table}')
exit(0)

format = 'csv' if format == 'F' else format.lower()
format = 'json' if format == 'F' else format.lower()
if format not in ['json', 'csv']:
print(f'‼️ Unsupported output format {format}. {hint}')
exit(1)
Expand Down
3 changes: 3 additions & 0 deletions admin/import-data
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ Command-line options summary
for file_name in zip_file.namelist():
for table_name, import_data in IMPORT_HANDLERS.items():
if table_name in file_name:
if zip_file.getinfo(file_name).file_size < 50:
print(f'File {file_name} inside ZIP archive has no data')
continue
with zip_file.open(file_name) as contents:
data = json.load(contents)
import_data(data, database, quiet)
Expand Down

0 comments on commit 5cdbcb8

Please sign in to comment.