From 73de75f6bdf2c2deb04f7c94ae62a2684af95759 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 20 Dec 2021 15:58:28 +0100 Subject: [PATCH 1/1] depot fix --- src/depot/admin.py | 5 +---- src/depot/models.py | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/depot/admin.py b/src/depot/admin.py index 35f721bd..eebf0102 100644 --- a/src/depot/admin.py +++ b/src/depot/admin.py @@ -4,7 +4,4 @@ from . import models @admin.register(models.Package) class PackageAdmin(admin.ModelAdmin): - filter_horizontal = ['books'] - pass - -# Register your models here. + raw_id_fields = ['books'] diff --git a/src/depot/models.py b/src/depot/models.py index c654d1b9..e3b6dfd8 100644 --- a/src/depot/models.py +++ b/src/depot/models.py @@ -35,13 +35,13 @@ class Package(models.Model): return json.loads(self.status_json) def set_status(self, status): - self.status_json = json.dumps(status, indent=4) + self.status_json = json.dumps(status, indent=4, ensure_ascii=False) def get_definition(self): return json.loads(self.definition_json) def set_definition(self, definition): - self.definition_json = json.dumps(definition, indent=4) + self.definition_json = json.dumps(definition, indent=4, ensure_ascii=False) def build(self): f = tempfile.NamedTemporaryFile(prefix='depot-', suffix='.zip', mode='wb', delete=False) -- 2.20.1