Skip to content

Commit

Permalink
Fix "Not a gzipped file" error in generate_dev_fixtures command.
Browse files Browse the repository at this point in the history
  • Loading branch information
berkerpeksag committed Apr 1, 2015
1 parent 550e0c4 commit 7ce5025
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cms/management/commands/generate_dev_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def handle(self, **options):
continue
try:
model = app_config.get_model(model_label)
print(model)
except LookupError:
raise CommandError("Unknown model: %s.%s" % (app_label, model_label))

Expand Down Expand Up @@ -114,6 +113,5 @@ def get_objects():
)

data = bytes(data, 'utf-8')
out = open(outputfile, 'wb')
out.write(gzip.compress(data))
out.close()
with gzip.open(outputfile, 'wb') as out:
out.write(data)

0 comments on commit 7ce5025

Please sign in to comment.