fixes
authorRadek Czajka <rczajka@rczajka.pl>
Sat, 23 May 2020 23:51:31 +0000 (01:51 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Sat, 23 May 2020 23:51:31 +0000 (01:51 +0200)
src/archive/admin.py
src/archive/migrations/0010_populate_license.py

index 397f973..577a0ae 100644 (file)
@@ -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)
index dc59bdc..9533003 100644 (file)
@@ -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