From 23994f414001d00c7e1dcad37a33cd7379d510e1 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Sun, 24 May 2020 01:51:31 +0200 Subject: [PATCH 1/1] fixes --- src/archive/admin.py | 11 +++++++++-- src/archive/migrations/0010_populate_license.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/archive/admin.py b/src/archive/admin.py index 397f973..577a0ae 100644 --- a/src/archive/admin.py +++ b/src/archive/admin.py @@ -1,6 +1,13 @@ -from archive.models import Project, Audiobook, Piece +from archive.models import Project, Audiobook, Piece, License from django.contrib import admin admin.site.register(Project) -admin.site.register(Audiobook) + + +class AudiobookAdmin(admin.ModelAdmin): + list_filter = ['license'] + + +admin.site.register(Audiobook, AudiobookAdmin) admin.site.register(Piece) +admin.site.register(License) diff --git a/src/archive/migrations/0010_populate_license.py b/src/archive/migrations/0010_populate_license.py index dc59bdc..9533003 100644 --- a/src/archive/migrations/0010_populate_license.py +++ b/src/archive/migrations/0010_populate_license.py @@ -10,7 +10,7 @@ def populate_license(apps, schema_editor): licenses = {} for a in Audiobook.objects.all(): if a.mp3_tags: - tags = json.loads(a.mp3_tags) + tags = json.loads(a.mp3_published_tags) uri = tags.get('license') if not uri: continue -- 2.20.1