From: Radek Czajka Date: Sat, 23 May 2020 23:51:31 +0000 (+0200) Subject: fixes X-Git-Url: https://git.mdrn.pl/audio.git/commitdiff_plain/23994f414001d00c7e1dcad37a33cd7379d510e1?ds=inline;hp=0678dd50bd89ef1ad0f0d95c1e7907e31187a0d3 fixes --- 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